Files
babashka-pod-docker/Dockerfile

29 lines
785 B
Docker
Raw Normal View History

2023-05-14 21:30:59 -07:00
# syntax = docker/dockerfile:1.4
FROM nixos/nix:latest AS builder
2023-05-14 21:30:59 -07:00
WORKDIR /tmp/build
RUN mkdir /tmp/nix-store-closure
2023-05-14 21:30:59 -07:00
RUN \
--mount=type=cache,target=/nix,from=nixos/nix:latest,source=/nix \
--mount=type=cache,target=/root/.cache \
--mount=type=bind,target=/tmp/build \
<<EOF
nix \
--extra-experimental-features "nix-command flakes" \
--extra-substituters "http://host.docker.internal?priority=10" \
--option filter-syscalls false \
--show-trace \
--log-format raw \
build . --out-link /tmp/output/result
cp -R $(nix-store -qR /tmp/output/result) /tmp/nix-store-closure
EOF
2023-05-14 21:30:59 -07:00
FROM scratch
2023-05-14 21:30:59 -07:00
WORKDIR /app
2023-05-14 21:30:59 -07:00
COPY --from=builder /tmp/nix-store-closure /nix/store
COPY --from=builder /tmp/output/ /app/
2023-05-18 00:48:57 -07:00
ENTRYPOINT ["/app/result/bin/entrypoint"]