init: Prove the concept of reproducible builds

This commit is contained in:
Matthew Binning 2025-12-12 14:34:46 -08:00
commit b957af3edb
No known key found for this signature in database
9 changed files with 2075 additions and 0 deletions

19
Dockerfile Normal file
View file

@ -0,0 +1,19 @@
FROM nixos/nix:latest
WORKDIR /app
COPY . .
RUN mkdir -p ~/.config/nix && \
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf && \
nix build .#app
# Extract the built binary
RUN cp -rL result/* /tmp/app/ || cp result /tmp/app/hello-world
# Use a minimal runtime image - no system dependencies needed!
FROM debian:bookworm-slim
# All functionality is in Rust crates, no need for system binaries
COPY --from=0 /tmp/app/ /usr/local/bin/
CMD ["/usr/local/bin/hello-world"]