12 ms·
That's actually something I've been discussing with a colleague - Nix is capable of building various other image types (netboot, qemu, etc.) and we could theore
by tazjin 7y ago
That's actually something I've been discussing with a colleague - Nix is capable of building various other image types (netboot, qemu, etc.) and we could theoretically extend Nixery to provide such images in addition.
- zimbatm 7y agosee also https://github.com/nix-community/nixos-generators/ https://github.com/nix-community/nixos-generators/
- StavrosK 7y ago(I know almost nothing about Nix, so take this question loosely) Do you know if there's an easy way to generate a Docker container from a Nix script? That could be a very nice alternative to a Dockerfile.
- tazjin 7y agoYes, you can do that using for example `buildLayeredImage`: { pkgs ? import <nixpkgs> {} }: with pkgs; dockerTools.buildLayeredImage { name = "curl-bash"; contents = [ curl bashInteractive coreutils ]; } Putting that in a file and calling `nix-build` on that file will give you a tarball that Docker will happily load using `docker load`. Doing this has a lot of advantages over Dockerfiles, see this blog post for some of the others: https://grahamc.com/blog/nix-and-layered-docker-images https://grahamc.com/blog/nix-and-layered-docker-images
- StavrosK 7y agoFantastic, thanks!