4 ms·
What exactly is involved in converting them to root filesystems?
by alexchamberlain 6y ago
What exactly is involved in converting them to root filesystems?
- iampims 6y agoI’d love to know more about this as well. That’s the part usually nobody talks about.
- e12e 6y agoHave a look at: https://stackoverflow.com/questions/23436613/how-can-i-convert-a-docker-image-into-a-vagrant-virtualbox-box#42845276 https://stackoverflow.com/questions/23436613/how-can-i-conve... Or "slim": https://news.ycombinator.com/item?id=20182141 https://news.ycombinator.com/item?id=20182141 Typically, a docker filesystem doesn't include a proper unit (docker will inject "tiny init") - so you would probably have to add a kernel, and init, somehow. I think I'd prefer to just create a vm, rather than re-use the pre-built docker.
- e12e 6y agoEd: a proper "init" not "unit"
- CodesInChaos 6y agoThe linked article contains a script building the file system. It creates a block device using `qemu-img`, adds an empty filesystem using `mkfs.ext4` and then simply mounts it and copies in the files. The previous posts cover this topic in more detail: Day 43: Building VM images - https://jvns.ca/blog/2021/01/21/day-43--building-vm-images/ https://jvns.ca/blog/2021/01/21/day-43--building-vm-images/ Day 44: Building my VMs with Docker - https://jvns.ca/blog/2021/01/22/day-44--got-some-vms-to-start-in-firecracker/ https://jvns.ca/blog/2021/01/22/day-44--got-some-vms-to-star...
- nicwolff 6y agoIt may not be what fly.io does but there's a walkthrough of the basic idea here https://iximiuz.com/en/posts/from-docker-container-to-bootable-linux-disk-image/ https://iximiuz.com/en/posts/from-docker-container-to-bootab...
- tptacek 6y agoIt's not a big secret or anything but it's changed recently and Jerome would do a better job of describing it than I would; apart from the filesystem stuff, we have an init we wrote in Rust that does a bunch of the lifting.
- jeromegn 6y agoWe use containerd with the devmapper snapshotter! Works nicely. We create a hard link to the resulting device for the root drive inside firecracker.