forked from ocurrent/docker-base-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (39 loc) · 1.99 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
FROM ocaml/opam:debian-10-ocaml-4.12@sha256:ba8cea1129194af6d938aa39bae99a534462c65c9512c8052d26c7d764e8549d AS build
RUN sudo apt-get update && sudo apt-get install libev-dev capnproto graphviz m4 pkg-config libsqlite3-dev libgmp-dev libssl-dev libffi-dev -y --no-install-recommends
RUN cd ~/opam-repository && git pull origin -q master && git reset --hard 1a8b75438a8a47be909af0e6c0768c25384697c6 && opam update
COPY --chown=opam \
ocurrent/current.opam \
ocurrent/current_web.opam \
ocurrent/current_docker.opam \
ocurrent/current_git.opam \
ocurrent/current_github.opam \
ocurrent/current_incr.opam \
ocurrent/current_slack.opam \
ocurrent/current_rpc.opam \
/src/ocurrent/
COPY --chown=opam \
ocluster/*.opam \
/src/ocluster/
WORKDIR /src
RUN opam pin add -yn current_docker.dev "./ocurrent" && \
opam pin add -yn current_git.dev "./ocurrent" && \
opam pin add -yn current_github.dev "./ocurrent" && \
opam pin add -yn current_incr.dev "./ocurrent" && \
opam pin add -yn current.dev "./ocurrent" && \
opam pin add -yn current_rpc.dev "./ocurrent" && \
opam pin add -yn current_slack.dev "./ocurrent" && \
opam pin add -yn current_web.dev "./ocurrent" && \
opam pin add -yn current_ocluster.dev "./ocluster" && \
opam pin add -yn ocluster-api.dev "./ocluster"
COPY --chown=opam base-images.opam /src/
RUN opam install -y --deps-only .
ADD --chown=opam . .
RUN opam config exec -- dune build ./src/base_images.exe
FROM debian:10
RUN apt-get update && apt-get install libev4 curl git graphviz libsqlite3-dev ca-certificates netbase gnupg2 -y --no-install-recommends
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN echo 'deb [arch=amd64] https://download.docker.com/linux/debian buster stable' >> /etc/apt/sources.list
RUN apt-get update && apt-get install docker-ce -y --no-install-recommends
COPY --from=build /src/_build/default/src/base_images.exe /usr/local/bin/base-images
WORKDIR /var/lib/ocurrent
ENTRYPOINT ["/usr/local/bin/base-images"]