3 ms·
Neat! Maybe out of place but is there something similar where a virtual machine is spun up rather than docker?
by tjoff 7y ago
Neat! Maybe out of place but is there something similar where a virtual machine is spun up rather than docker?
- tazjin 7y agoThat'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!
- moosingin3space 7y agoThat can be made a runtime concern - if you use Kata Containers as a runtime for Docker, it'll use a VM instead of kernel namespaces.