-
Notifications
You must be signed in to change notification settings - Fork 152
/
Dockerfile
44 lines (29 loc) · 1.23 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
FROM ocaml/opam2:alpine
RUN sudo apk add --no-cache tzdata aspcud gmp-dev perl libev-dev m4
RUN opam switch 4.07
ENV OPAMERRLOGLEN=0 OPAMYES=1
RUN git -C /home/opam/opam-repository fetch origin && \
git -C /home/opam/opam-repository reset 340acb7d88264bf29485b1d292388e1d91dc2214 --hard && \
opam update -u
RUN opam install alcotest lwt conf-libev inotify
COPY check-libev.ml /tmp/check-libev.ml
RUN opam exec -- ocaml /tmp/check-libev.ml
# cache opam install of dependencies
COPY *.opam /home/opam/src/datakit/
RUN opam pin add /home/opam/src/datakit/ -n
# install dependencies
RUN opam install datakit --deps -t
# copy local sources
COPY . /home/opam/src/datakit
RUN sudo chown opam.nogroup -R /home/opam/src/datakit
RUN opam update --dev && opam upgrade
RUN opam install datakit -ytv
RUN sudo cp $(opam config exec -- which datakit) /usr/bin/datakit && \
sudo cp $(opam config exec -- which datakit-mount) /usr/bin/datakit-mount
FROM alpine:3.9
RUN apk add --no-cache libev gmp tzdata ca-certificates git openssh-client bash
EXPOSE 5640
ENTRYPOINT ["/usr/bin/datakit"]
CMD ["--url=tcp://0.0.0.0:5640", "--git=/data", "-v"]
COPY --from=0 /usr/bin/datakit /usr/bin/datakit
COPY --from=0 /usr/bin/datakit-mount /usr/bin/datakit-mount