File tree Expand file tree Collapse file tree 8 files changed +77
-73
lines changed
Expand file tree Collapse file tree 8 files changed +77
-73
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ FROM ubuntu:22.04 AS Builder
2+
3+ ENV OPAMROOT=/opt/ocaml
4+
5+ RUN set -ex; \
6+ mkdir -p $OPAMROOT; \
7+ useradd --create-home codewarrior; \
8+ chown codewarrior:codewarrior $OPAMROOT; \
9+ apt-get update; \
10+ apt-get install -y --no-install-recommends \
11+ software-properties-common \
12+ libgmp-dev \
13+ opam \
14+ ;
15+
16+ USER codewarrior
17+ ENV USER=codewarrior
18+
19+ RUN set -ex; \
20+ opam init -y --disable-sandboxing --compiler=5.0.0;
21+
22+ RUN set -ex; \
23+ opam install -y \
24+ 'batteries=3.6.0' \
25+ 'base=v0.15.1' \
26+ 'domainslib=0.5.0' \
27+ 'ocamlbuild=0.14.2' \
28+ 'ocamlfind=1.9.6' \
29+ 'ounit2=2.2.7' \
30+ 'zarith=1.12' \
31+ ;
32+
33+ FROM ubuntu:22.04
34+
35+ RUN set -ex; \
36+ apt-get update; \
37+ apt-get install -y --no-install-recommends \
38+ gcc \
39+ libc6-dev \
40+ libgmp-dev \
41+ ; \
42+ rm -rf /var/lib/apt/lists/*;
43+
44+ COPY --from=builder \
45+ /opt/ocaml/5.0.0/bin/ocamlc.opt \
46+ /opt/ocaml/5.0.0/bin/ocamlopt.opt \
47+ /opt/ocaml/5.0.0/bin/ocamldep.opt \
48+ /opt/ocaml/5.0.0/bin/ocamlbuild \
49+ /opt/ocaml/5.0.0/bin/ocamlfind \
50+ /opt/ocaml/5.0.0/bin/
51+ COPY --from=builder \
52+ /opt/ocaml/5.0.0/lib/ /opt/ocaml/5.0.0/lib/
53+
54+ RUN set -ex; \
55+ useradd --create-home codewarrior; \
56+ mkdir -p /workspace; \
57+ chown -R codewarrior:codewarrior /workspace;
58+
59+ USER codewarrior
60+ ENV USER=codewarrior \
61+ PATH=/opt/ocaml/5.0.0/bin:$PATH
62+
63+ COPY --chown=codewarrior:codewarrior workspace/. /workspace/
64+ WORKDIR /workspace
Original file line number Diff line number Diff line change 1- docker build -t ocaml:latest .
1+ docker build -t ocaml:alpine .
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11W=/workspace
22# Create container
33BUILD="ocamlbuild -quiet -use-ocamlfind cwtest.native"
4- C=$(docker container create --rm -w $W ocaml:latest sh -c "$BUILD && exec ./cwtest.native")
4+ C=$(docker container create --rm -w $W ocaml:alpine sh -c "$BUILD && exec ./cwtest.native")
55
66# Copy files
77docker container cp ${1:-examples/basic}/. $C:$W
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ docker build -f DockerfileUbuntu -t ocaml:ubuntu .
Original file line number Diff line number Diff line change 1+ W=/workspace
2+ # Create container
3+ BUILD="ocamlbuild -quiet -use-ocamlfind cwtest.native"
4+ C=$(docker container create --rm -w $W ocaml:ubuntu sh -c "$BUILD && exec ./cwtest.native")
5+
6+ # Copy files
7+ docker container cp ${1:-examples/basic}/. $C:$W
8+
9+ # Start
10+ docker container start --attach $C
You can’t perform that action at this time.
0 commit comments