Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
From Docker Container to Bootable Linux Disk Image (micromind.me)
93 points by c8g on June 10, 2019 | hide | past | favorite | 20 comments


My 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


Can it be used to provision VMs entirely from docker, or does it have to be bare metal only?


In short, no: while we do run dock2box regularly to rebuild VMs, internally our VM creation process is separate from this tool.


I 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.


Yeah, the project is LinuxKit (also by Docker).

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.


I 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


I suppose you can always fork and create UnixKit :)


Correct me if I'm wrong, but this sounds a little like a buildroot. https://buildroot.org


Packer, from hashicorp, allows you to create various image-types from a JSON configuration file.

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.


I 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.


Packer 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.


Packer can be lower level but it can also do what Dockerfile do, see https://www.packer.io/docs/builders/docker.html for the Docker support in Packer.


NixOS makes this nearly trivial. Any system configuration can be turned into an ISO by requesting the 'iso' attribute instead of the 'system' one.


yep...

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://godarch.com/

It integrates directly with Grub for easy booting.


Someone in the comments on this site posted darch [0]. Looks interesting.

[0] https://godarch.com/



Author 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


Since 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!





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: