-
Notifications
You must be signed in to change notification settings - Fork 74
/
Dockerfile
60 lines (59 loc) · 2.95 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# syntax=docker/dockerfile:1
FROM ocaml/opam:debian-12-ocaml-4.14@sha256:aeed2457dc910827bacd43f1f7bcc0759d6c6e6c676c062fd0c9adf7989965c2 AS build
RUN sudo ln -f /usr/bin/opam-2.2 /usr/bin/opam && opam init --reinit -ni
RUN sudo apt-get update && sudo apt-get install libcapnp-dev libffi-dev libev-dev capnproto m4 pkg-config libsqlite3-dev libgmp-dev graphviz -y --no-install-recommends
RUN cd ~/opam-repository && git fetch -q origin master && git reset --hard 9048aac6300c8d05712e1840046eeff812969745 && 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_web.opam \
/src/ocurrent/
COPY --chown=opam \
ocluster/ocluster-api.opam \
ocluster/current_ocluster.opam \
/src/ocluster/
COPY --chown=opam \
solver-service/solver-service-api.opam \
solver-service/solver-service.opam \
solver-service/solver-worker.opam \
/src/solver-service/
COPY --chown=opam \
ocaml-dockerfile/dockerfile*.opam \
/src/ocaml-dockerfile/
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_web.dev "./ocurrent" && \
opam pin add -yn current_ocluster.dev "./ocluster" && \
opam pin add -yn dockerfile.dev "./ocaml-dockerfile" && \
opam pin add -yn dockerfile-opam.dev "./ocaml-dockerfile" && \
opam pin add -yn solver-service-api.dev "./solver-service" && \
opam pin add -yn solver-service.dev "./solver-service" && \
opam pin add -yn solver-worker.dev "./solver-service" && \
opam pin add -yn ocluster-api.dev "./ocluster"
COPY --chown=opam ocaml-ci.opam ocaml-ci-service.opam ocaml-ci-api.opam /src/
RUN opam install -y --deps-only .
ADD --chown=opam . .
RUN opam exec -- dune build ./_build/install/default/bin/ocaml-ci-service
FROM debian:12
RUN apt-get update && apt-get install libev4 openssh-client curl gnupg2 dumb-init git graphviz libsqlite3-dev ca-certificates netbase -y --no-install-recommends
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN echo 'deb https://download.docker.com/linux/debian bookworm stable' >> /etc/apt/sources.list
RUN apt-get update && apt-get install docker-ce docker-buildx-plugin -y --no-install-recommends
WORKDIR /var/lib/ocurrent
ENTRYPOINT ["dumb-init", "/usr/local/bin/ocaml-ci-service"]
ENV OCAMLRUNPARAM=a=2
# Enable experimental for docker manifest support
ENV DOCKER_CLI_EXPERIMENTAL=enabled
COPY --from=build /src/_build/install/default/bin/ocaml-ci-service /src/_build/install/default/bin/solver-service /usr/local/bin/
# Create migration directory
RUN mkdir -p /migrations
COPY --from=build /src/migrations /migrations