forked from ocurrent/opam-repo-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (38 loc) · 2.05 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
FROM ocaml/opam:debian-11-ocaml-4.12 AS build
RUN sudo apt-get update && sudo apt-get install libev-dev capnproto graphviz m4 pkg-config libsqlite3-dev libgmp-dev libffi-dev -y --no-install-recommends
RUN cd ~/opam-repository && git pull origin master && git reset --hard 81d2d054a0c2686544e2a651a8154a584dba8403 && opam update
COPY --chown=opam \
ocurrent/current_ansi.opam \
ocurrent/current_docker.opam \
ocurrent/current_github.opam \
ocurrent/current_git.opam \
ocurrent/current_incr.opam \
ocurrent/current.opam \
ocurrent/current_rpc.opam \
ocurrent/current_slack.opam \
ocurrent/current_web.opam \
/src/ocurrent/
WORKDIR /src
RUN opam pin add -yn current_ansi.dev "./ocurrent" && \
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_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"
COPY --chown=opam opam-repo-ci-service.opam opam-repo-ci-api.opam /src/
RUN opam install -y --deps-only .
ADD --chown=opam . .
RUN opam config exec -- dune build ./_build/install/default/bin/opam-repo-ci-service
FROM debian:11
RUN apt-get update && apt-get install libev4 openssh-client curl gnupg2 dumb-init git graphviz libsqlite3-dev ca-certificates netbase gzip bzip2 xz-utils unzip tar -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 bullseye stable' >> /etc/apt/sources.list
RUN apt-get update && apt-get install docker-ce -y --no-install-recommends
RUN git config --global user.name "ocaml" && git config --global user.email "ci"
WORKDIR /var/lib/ocurrent
ENTRYPOINT ["dumb-init", "/usr/local/bin/opam-repo-ci-service"]
ENV OCAMLRUNPARAM=a=2
COPY --from=build /src/_build/install/default/bin/opam-repo-ci-service /usr/local/bin/