Docker Community Forums

Share and learn in the Docker community.

Host VHD based VMs in Docker

I am new to Docker. I am wondering if my following scenario will work by using Docker.
I have multiple vhd based VMs (basically IaaS VMs in Azure). Can I move them to Docker in Azure? The main purpose is to make all these VMs share the same Docker VM’s computational resource.
In the non Azure context, basically I want to move vhd based VMs to a Docker instance.
If it’s doable, could you please give me some high level implementation overview?
Thank you all

You can migrate workloads that you’re currently using from VMs based on VHDs to containers that run on Docker, you will need to docker build (i.e., write them a Dockerfile) and docker run them yourself though.

You can’t port whole VMs to only one container, generally speaking. You usually want each container to have only one concern but a VM might run a whole boatload of processes. See this link for more info:

If you were really in a pinch though, you might be able to tar up the root filesystem of the VM and docker import it. It’s just really quite heavyweight / inelegant compared to making images directly…