flake plus docker cli metadata
This commit is contained in:
24
Dockerfile
24
Dockerfile
@@ -1,4 +1,26 @@
|
|||||||
FROM golang:1.19-alpine AS build
|
# syntax = docker/dockerfile:1.4
|
||||||
|
FROM nixos/nix:latest AS builder
|
||||||
|
|
||||||
|
WORKDIR /tmp/build
|
||||||
|
RUN mkdir /tmp/nix-store-closure
|
||||||
|
|
||||||
|
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
|
||||||
|
ls -l /nix/store | wc
|
||||||
|
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
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user