4 ms·
From Docker Container to Bootable Linux Disk Image
- ohiovr 7y agoI would like to have something like docker where I can describe a system kind of like a docker file but output an ISO file instead of running it as a container. Does something like this exist? I can't seem to find any user friendly tools for tailoring distros. In many cases you have to mouse around. I just want to do it with a script.
- dijit 7y agoCorrect me if I'm wrong, but this sounds a little like a buildroot. https://buildroot.org https://buildroot.org
- stevekemp 7y agoPacker, from hashicorp, allows you to create various image-types from a JSON configuration file. https://www.packer.io/ https://www.packer.io/ It's a little bit more low-level, but I use it to build images which run under VMWare and on EC2 in AWS. I tend to just use the configuration file to install ansible inside the new instance, then configure the actual system like that.
- eatonphil 7y agoI haven't used packer but it seems like operates at a different level? Dockerfiles are mostly about _provisioning_ an existing system but packer was more about getting correct configuration in place for VM providers and allowing you to specify strings to be run for provisioning. Edit: not an edit, but I realize it's a double standard to think of Dockerfile's as anything but specifying strings for provisioning.
- Znafon 7y agoPacker can be lower level but it can also do what Dockerfile do, see https://www.packer.io/docs/builders/docker.html https://www.packer.io/docs/builders/docker.html for the Docker support in Packer.
- y4mi 7y agoPacker is for building base images. You obviously need some provisioning there as well, but the focus is definitely on shipping iso images. Vagrant fits what you're after, but it'd wager you wouldn't be happy with it either. It's essentially a Ruby dsl with the same goal as docker, though vagrant is way older (and still works just fine if you actually need such automated provisioning). Testkitchen uses it if you're into infrastructure automation and want to see what sysadmins had pre docker.
- sansnomme 7y agoYeah, the project is LinuxKit (also by Docker). https://github.com/linuxkit/linuxkit/blob/master/README.md https://github.com/linuxkit/linuxkit/blob/master/README.md It is mostly for cloud systems (last I checked the Alpine distro was a core dependency) and is still a bit raw but a vast improvement compared to what's currently available. Existing solutions like Buildroot/Yocto etc. have a horrendous UX, think editing Makefiles by hand while LinuxKit is Docker-style single yaml defined immutable system + go binary build tool with a unified interface. There are also stuff like Nix and GUIX but the learning curve is non-negligible and have a lot less money driving the development.
- eatonphil 7y agoI was looking at tools a while ago at Linode while trying to automate support for FreeBSD/OpenBSD/etc. The UX for different distributions (if provided at all) is disparate, confusing, and poorly documented. I ended up giving up and just building the images by hand and hosting them [0]. I've seen linuxkit a few times now but it didn't click that this is what it does. The problem still remains that there's no good distribution-agnostic combination of boot image creator + provisioning system. The ideal situation is one tool that allows me to start with an arbitrary base distribution, provision it, and build a bootable image for the VM provider of my choice (VirtualBox, EC2, bhyve, etc.). [0] https://github.com/eatonphil/linode_deploy_experimental https://github.com/eatonphil/linode_deploy_experimental
- sansnomme 7y agoI suppose you can always fork and create UnixKit :)
- Filligree 7y agoNixOS makes this nearly trivial. Any system configuration can be turned into an ISO by requesting the 'iso' attribute instead of the 'system' one.
- geggam 7y agoyep... and if we go deeper you can also see isolinux has been doing this for sometime https://wiki.syslinux.org/wiki/index.php?title=ISOLINUX https://wiki.syslinux.org/wiki/index.php?title=ISOLINUX
- pknopf 7y agohttps://godarch.com/ https://godarch.com/ It integrates directly with Grub for easy booting.
- deleted 7y ago[deleted]
- eatonphil 7y agoSomeone in the comments on this site posted darch [0]. Looks interesting. [0] https://godarch.com/ https://godarch.com/
- agumonkey 7y agoI missed that entirely.. surprising. https://old.reddit.com/r/archlinux/comments/7uqf88/announcing_darch_a_tool_written_in_go_for_booting/ https://old.reddit.com/r/archlinux/comments/7uqf88/announcin...
- pknopf 7y agoAuthor here, if anyone has any questions. I've been using it for over a year with Ubuntu. Here are my recipes: https://github.com/pauldotknopf/darch-recipes https://github.com/pauldotknopf/darch-recipes
- eatonphil 7y agoSince the darch site and repo have no clear examples it kind of looks like vaporware. It's good to see this darch-recipes repo! I recommend adding some links or showing examples on the main site and repo too!
- pknopf 7y agoThe "test drive" allows you to run it in a VM. https://godarch.com/test-drive/ https://godarch.com/test-drive/ Check this: https://pknopf.com/post/2018-11-09-give-ubuntu-darch-a-quick-ride-in-a-virtual-machine/ https://pknopf.com/post/2018-11-09-give-ubuntu-darch-a-quick...
- pbh101 7y agoMy employer built a tool which skips the disk image step and provisions a machine directly from a Docker image. The system is still maintained and in active use, though the open-source repo is a trailing fork: https://github.com/imc-trading/dock2box https://github.com/imc-trading/dock2box