<commit_before>FROM ocaml/opam2:alpine-3.10-ocaml-4.07 as build
ADD . /home/opam/src
# Latest packages plus some overrides are in this repo:
RUN opam remote add vpnkit /home/opam/src/repo/darwin
RUN opam pin add -y -n vpnkit /home/opam/src
RUN opam depext vpnkit -y
RUN opam pin add -y -n tcpip https://github.com/djs55/mirage-tcpip.git#vpnkit-20180607
# Work around uri build failure
ENV OPAMJOBS=1
RUN opam install re.1.9.0
RUN opam install uri.2.2.1
RUN opam install --deps-only vpnkit -y
RUN opam pin remove vpnkit
WORKDIR /home/opam/src
RUN opam exec -- sudo dune build src/bin/main.exe

FROM scratch
COPY --from=build /home/opam/src/_build/default/src/bin/main.exe /vpnkit<commit_msg>Dockerfile: update to OCaml 4.10<commit_after>FROM ocaml/opam2:alpine-3.10-ocaml-4.10 as build

RUN opam pin add fd-send-recv.2.0.1 https://github.com/xapi-project/ocaml-fd-send-recv/archive/v2.0.1.tar.gz
# A small fork of the tcpip stack
RUN opam pin add tcpip.3.3.0 "https://github.com/djs55/mirage-tcpip.git#vpnkit-20180607" -n
# This has been released in version 2 but with some other incompatible changes
RUN opam pin add hvsock.1.0.1 "git://github.com/djs55/ocaml-hvsock.git#relative-paths" -n

ADD . /home/opam/src
RUN opam pin add -y -n vpnkit /home/opam/src
RUN opam depext vpnkit -y

# Work around uri build failure (maybe remove when we update jbuilder/dune)
ENV OPAMJOBS=1
RUN opam install re.1.9.0
RUN opam install uri.2.2.1
ENV OPAMJOBS=8

RUN opam install --deps-only vpnkit -y

WORKDIR /home/opam/src
RUN opam exec -- sudo dune build --profile release

FROM alpine:latest
COPY --from=build /home/opam/src/_build/default/src/bin/main.exe /vpnkit
{'fraction_non_alphanumeric': 0.11272727272727273, 'fraction_numerical': 0.040606060606060604, 'mean_word_length': 3.611731843575419, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3036337', 'n_tokens_mistral': 685, 'n_tokens_neox': 650, 'n_words': 190}