use alpine base for final image
This commit is contained in:
parent
f7a04b7a85
commit
5ed5cb6dde
1 changed files with 12 additions and 3 deletions
15
Dockerfile
15
Dockerfile
|
@ -1,10 +1,19 @@
|
||||||
FROM nixos/nix:latest
|
FROM nixos/nix:latest AS builder
|
||||||
WORKDIR /app
|
WORKDIR /build
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN nix \
|
RUN nix \
|
||||||
--extra-experimental-features "nix-command flakes" \
|
--extra-experimental-features "nix-command flakes" \
|
||||||
build .#app
|
build .#app
|
||||||
|
|
||||||
CMD [ "/app/result/bin/app" ]
|
RUN mkdir -p /tmp/nix-store-closure
|
||||||
|
RUN cp -ra $(nix-store -qR result/) /tmp/nix-store-closure
|
||||||
|
|
||||||
|
FROM alpine:latest
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=builder /tmp/nix-store-closure /nix/store
|
||||||
|
COPY --from=builder /build/result /app
|
||||||
|
|
||||||
|
CMD [ "/app/bin/app" ]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue