aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
blob: f45f0ebad6686b0e96d0402d2d20604e03a78b08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM nixos/nix:latest AS builder

# Install system dependencies
COPY . /tmp/build
WORKDIR /tmp/build

RUN nix \
    --extra-experimental-features "nix-command flakes" \
    --option filter-syscalls false \
    build

nix develop -c dune build

RUN mkdir /tmp/nix-store-closure
RUN cp -R $(nix-store -qR result/) /tmp/nix-store-closure

FROM scratch

WORKDIR /app

# Copy /nix/store
COPY --from=builder /tmp/nix-store-closure /nix/store
COPY --from=builder /tmp/build/result/ /app
ENTRYPOINT /app/bin/wormhole