-
Notifications
You must be signed in to change notification settings - Fork 2
/
DockerfileAlpine
63 lines (52 loc) · 1.35 KB
/
DockerfileAlpine
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
FROM alpine:3.17 AS builder
ENV OPAMROOT=/opt/ocaml
RUN set -ex; \
mkdir -p $OPAMROOT; \
adduser -D codewarrior; \
chown -R codewarrior:codewarrior /opt/ocaml; \
apk update; \
apk add --virtual .build-deps \
build-base \
ocaml-compiler-libs \
gmp-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 alpine:3.17
RUN set -ex; \
apk add --no-cache \
gcc \
gmp-dev \
musl-dev \
;
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; \
adduser -D codewarrior; \
mkdir /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