-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
43 lines (42 loc) · 2.19 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
FROM ocaml/opam:debian-12-ocaml-4.14@sha256:06d58a5cb1ab7875e8d94848102be43f6492e95320e8e9a9ecb9167654d0ee3f AS build
RUN sudo apt-get update && sudo apt-get install libffi-dev libev-dev m4 pkg-config libsqlite3-dev libgmp-dev libssl-dev capnproto graphviz -y --no-install-recommends
RUN cd ~/opam-repository && git fetch -q origin master && git reset --hard 6d3d7021d944058cc7531905e065fe2cd72f01e8 && opam update
COPY --chown=opam \
ocurrent/current_docker.opam \
ocurrent/current_github.opam \
ocurrent/current_git.opam \
ocurrent/current.opam \
ocurrent/current_rpc.opam \
ocurrent/current_slack.opam \
ocurrent/current_ssh.opam \
ocurrent/current_web.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_github.dev "./ocurrent" && \
opam pin add -yn current_git.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_ssh.dev "./ocurrent" && \
opam pin add -yn current_web.dev "./ocurrent" && \
opam pin add -yn ocluster-api.dev "./ocluster"
COPY --chown=opam deployer.opam /src/
RUN opam pin -yn add .
RUN opam install -y --deps-only .
ADD --chown=opam . .
RUN opam config exec -- dune build ./_build/install/default/bin/ocurrent-deployer
FROM debian:12
RUN apt-get update && apt-get install libffi-dev libev4 openssh-client curl gnupg2 dumb-init git graphviz libsqlite3-dev ca-certificates netbase rsync awscli -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 bookworm stable' >> /etc/apt/sources.list
RUN apt-get update && apt-get install docker-ce docker-ce-cli docker-buildx-plugin docker-compose-plugin -y --no-install-recommends
WORKDIR /var/lib/ocurrent
ENTRYPOINT ["dumb-init", "/usr/local/bin/ocurrent-deployer"]
COPY create-config.sh create-config.sh
RUN ./create-config.sh
RUN docker context use default
COPY --from=build /src/_build/install/default/bin/ocurrent-deployer /usr/local/bin/