Docker Community Forums

Share and learn in the Docker community.

Deploy a docker container as a VM


(Raimonbosch) #1

Hi,

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,


(Nathan Le Claire) #2

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.


(Raimonbosch) #3

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