diff options
author | Marc Coquand <marcc@fastmail.fr> | 2023-12-04 19:33:34 -0600 |
---|---|---|
committer | Marc Coquand <marcc@fastmail.fr> | 2023-12-04 19:33:34 -0600 |
commit | 5802ae011093ca4e138ad82fcd0ee14bbcc6f20f (patch) | |
tree | ffd49a3d25fd61e35c1f379a9ce150908485cafc /Dockerfile | |
parent | 2c6445f32891a5f7163fbf9b1d13613ba16832c7 (diff) | |
download | wormhole-5802ae011093ca4e138ad82fcd0ee14bbcc6f20f.tar.gz wormhole-5802ae011093ca4e138ad82fcd0ee14bbcc6f20f.tar.bz2 wormhole-5802ae011093ca4e138ad82fcd0ee14bbcc6f20f.zip |
Add nix
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -1,22 +1,22 @@ -FROM ocaml/opam:alpine as build +FROM nixos/nix:latest AS builder # Install system dependencies -RUN sudo apk add --update libev-dev openssl-dev gmp-dev gmp -WORKDIR /home/opam +COPY . /tmp/build +WORKDIR /tmp/build -# Install dependencies -ADD wormhole.opam wormhole.opam -RUN opam install . --deps-only +RUN nix \ + --extra-experimental-features "nix-command flakes" \ + --option filter-syscalls false \ + build -# Build project -ADD . . -RUN opam exec -- dune build -j 1 +RUN mkdir /tmp/nix-store-closure +RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure +FROM scratch -FROM alpine:3.18.4 as run +WORKDIR /app -RUN apk add --update libev openssl gmp - -COPY --from=build /home/opam/_build/default/bin/main.exe /bin/app - -ENTRYPOINT /bin/app +# Copy /nix/store +COPY --from=builder /tmp/nix-store-closure /nix/store +COPY --from=builder /tmp/build/result/ /app +ENTRYPOINT /app/bin/wormhole |