Building a Nix image inside a container
# build nix
docker build -t nix .
# build the image (creates a docker-image file in current path)
docker run -v $(pwd):/build -it nix
# load image into local registry
docker load < docker-image
# should be most recent image
docker images
# look at files
dive bash:latest
# jump into bash in container
docker run -it bash:latest
# use curl inside the container
curl https://www.google.com
# ignore tls certs
curl -k https://www.google.com
# zero vulnerabilities for bash
docker scan bash:latest
# debugging
docker run -v $(pwd):/build -it --entrypoint /bin/sh nix
nix-build --show-trace
- Good example nix buildImage here