Deploy a docker container as a VM


I was wondering if there is any method to convert a docker image obtained by “docker build .” into a QEMU image that can be deployed in any OpenStack installation. I guess that there are several steps that must be done to remove all the container architecture from the original image.

Any thoughts?

Thanks in advance,

Heh… I’m not 100% sure why you want to (why not spin up a normal VM running Docker and just run the image directly?), but it might help to know that docker export will output a TAR archives of the container’s entire root filesystem (without layers preserved, like docker save would do). You might be able to use that to bake a new OpenStack image from scratch, but getting things like init etc. to work properly might be pesky. Also, containers are usually missing some things you take for granted like man.

Another option: Convert your existing Dockerfile into an install script, and bake the image using a tool like Packer.

Basically I would like to reuse the Dockerfile installation steps I already have to build regular VM machines.