-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathDockerfile.worker
19 lines (18 loc) · 1.16 KB
/
Dockerfile.worker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM ocaml/opam:ubuntu-22.04-ocaml-4.14@sha256:41ce765f59ecde9d8525ec58e0da7cd1317f3798d2c4951186aeef2ce804fad5 AS build
RUN sudo apt-get update && sudo apt-get install libev-dev capnproto libcapnp-dev m4 pkg-config libsqlite3-dev libgmp-dev -y --no-install-recommends
RUN sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam && opam init --reinit -ni
RUN cd ~/opam-repository && git fetch -q origin master && git reset --hard 47a1176c71e6b07f26b724409a88340f8bac3a42 && opam update
COPY --chown=opam ocluster-api.opam ocluster-worker.opam ocluster.opam /src/
COPY --chown=opam obuilder/obuilder.opam obuilder/obuilder-spec.opam /src/obuilder/
RUN opam pin -yn /src/obuilder/
WORKDIR /src
RUN opam install -y --deps-only .
ADD --chown=opam . .
RUN opam exec -- dune subst
RUN opam exec -- dune build ./_build/install/default/bin/ocluster-worker
FROM ubuntu:jammy-20221130
RUN apt-get update && apt-get install docker.io libev4 curl gnupg2 git libsqlite3-dev ca-certificates netbase -y --no-install-recommends
WORKDIR /var/lib/ocluster-worker
ENTRYPOINT ["/usr/local/bin/ocluster-worker"]
ENV PROGRESS_NO_TRUNC=1
COPY --from=build /src/_build/install/default/bin/ocluster-worker /usr/local/bin/