From Docker Container to Bootable Linux Disk Image

Well, I don’t see any practical applications of the approach I’m going to describe… However, I do think that messing about with things like this is the only way to gain extra knowledge of any system internals. We are going to speak Docker and Linux here. What if we want to take a base Docker image, I mean really base, just an image made with a single line Dockerfile like FROM debian:latest, and convert it to something launchable on a real or virtual machine? In other words, can we create a disk image having exactly the same Linux userland a running container has and then boot from it? For this we would start with dumping container’s root file system, luckily it’s as simple as just running docker export, however, to finally accomplish the task a bunch of additional steps is needed…

3 Likes

Corresponding tweet for this thread:

https://twitter.com/dev_talk/status/1354891005305245702

Share link for this tweet.

1 Like