| Good morning, it is time to do cursed things
# ATTN: This Dockerfile is only here to provide compatibility
# We are now building images using Nix (https://nixos.org)
# Building using this Dockerfile is discouraged, it may also be flimsy
from nixpkgs/nix as builder
env NIX_PATH="nixpkgs=channel:nixos-20.09"
workdir /src
# You have to edit this to actually copy project sources over
copy default.nix .
run nix build \
--print-build-logs \
--option filter-syscalls false \
--option keep-build-log false \
--option max-jobs auto \
--option sandbox false \
&& mkdir /archive \
&& tar zxf ./result -C /archive \
&& mkdir /fs \
&& nix run nixpkgs.jq -c jq -r '.[0].Layers[]' /archive/manifest.json \
| nix run nixpkgs.findutils -c xargs -i tar xf /archive/{} -C /fs
from scratch as runner
copy --from=builder /fs /
# You might need to set CMD or ENTRYPOINT here
|