nix-community / docker-nixpkgs

docker images from nixpkgs [maintainer=@zimbatm]
https://hub.docker.com/u/nixpkgs
MIT License
185 stars 36 forks source link

nix with docker #73

Open adminy opened 11 months ago

adminy commented 11 months ago

Given that the only way to build docker images using a nix command needs to do docker load command, why was docker not built-in to nixos/nix? Or at least some image that has nixos/docker-nix

here is my example:

image:
    docker run --privileged \
        --mount type=bind,source=${PWD}/.github/workflows,target=/etc/nixos \
        --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
        -it nixos/nix nix-shell -p docker --run \
        "docker load --input \$$(nix-build /etc/nixos/image.nix)"
    # docker push