-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
64 lines (53 loc) · 1.46 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM ubuntu:22.04 AS Builder
ENV OPAMROOT=/opt/ocaml
RUN set -ex; \
mkdir -p $OPAMROOT; \
useradd --create-home codewarrior; \
chown codewarrior:codewarrior $OPAMROOT; \
apt-get update; \
apt-get install -y --no-install-recommends \
software-properties-common \
libgmp-dev \
opam \
;
USER codewarrior
ENV USER=codewarrior
RUN set -ex; \
opam init -y --shell-setup --disable-sandboxing --compiler=5.0.0;
RUN set -ex; \
opam install -y \
'batteries=3.6.0' \
'base=v0.15.1' \
'domainslib=0.5.0' \
'ocamlbuild=0.14.2' \
'ocamlfind=1.9.6' \
'ounit2=2.2.7' \
'zarith=1.12' \
;
FROM ubuntu:22.04
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
gcc \
libc6-dev \
libgmp-dev \
; \
rm -rf /var/lib/apt/lists/*;
COPY --from=builder \
/opt/ocaml/5.0.0/bin/ocamlc.opt \
/opt/ocaml/5.0.0/bin/ocamlopt.opt \
/opt/ocaml/5.0.0/bin/ocamldep.opt \
/opt/ocaml/5.0.0/bin/ocamlbuild \
/opt/ocaml/5.0.0/bin/ocamlfind \
/opt/ocaml/5.0.0/bin/
COPY --from=builder \
/opt/ocaml/5.0.0/lib/ /opt/ocaml/5.0.0/lib/
RUN set -ex; \
useradd --create-home codewarrior; \
mkdir -p /workspace; \
chown -R codewarrior:codewarrior /workspace;
USER codewarrior
ENV USER=codewarrior \
PATH=/opt/ocaml/5.0.0/bin:$PATH
COPY --chown=codewarrior:codewarrior workspace/. /workspace/
WORKDIR /workspace