aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile22
1 files changed, 22 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..cba9fcf
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,22 @@
+# hadolint ignore=DL3007
+FROM nixos/nix:latest AS builder
+
+COPY . /tmp/build
+WORKDIR /tmp/build
+
+RUN nix \
+ --extra-experimental-features "nix-command flakes" \
+ --option filter-syscalls false \
+ build .
+
+# we actually want to split
+# hadolint ignore=SC2046
+RUN mkdir /tmp/nix-store-closure && \
+ cp -R $(nix-store -qR result/) /tmp/nix-store-closure
+
+FROM scratch
+
+COPY --from=builder /tmp/nix-store-closure /nix/store
+COPY --from=builder /tmp/build/result /
+ENV PATH=/bin
+ENTRYPOINT ["/bin/bash"]