Docker Community Forums

Share and learn in the Docker community.

Can convert a docker image to a virtual machine?


(Luongutnho) #1

Hi All,

Now my system have 3server already running docker, but now i want get 1 images out docker and run on other virtual machine. but i don’t know.
Please help me any solution step by step ?

Thanks,
Ut Nho ( Ho Chi Minh city)


(Goffinf) #2

Pretty odd question title which I’m sure you don’t really mean. If you want to run an image that you currently have on one of your VMs on another there are a number of possible options, the most obvious being ,

  • docker pull namespace/image:tag
  • docker run … options namespace/image:tag
  • docker build -t namespace/image:tag location-of-Dockerfile

Or, from a VM that has the image you need …

docker save -o my_image.tar namespace/image:tag

Then on the VM where you need the image …

docker load -i my_image.tar

HTHs

Fraser.


(Luongutnho) #3

Hi my friends,

Thank you for the reply.
I’m from Ho Chi Minh city. i don’t know docker pro so pls advice help me step by step basic again.
I try again long time but can’t beause my company only me IT so when i doing it’s error i can’t question who ?
thanks so much .

Regards,
Nho.


(Goffinf) #4

All the steps you need I described above. There really isn’t any more detail than that.

So, let me ask you this, how did you start the containers that you have on your current VMs ?

What’s stopping you doing exactly the same on other VMs ?

Have you tried that and it didn’t work, and if so, post here what exactly you tried and what the output was.

Other than that, you probably just need to google and search for ‘docker tutorial’ and just learn some of the basics.

Sorry if that sounds a bit patronising, but this is kinda 101 level stuff, and if your company is relying on you as a software professional you owe it to yourself and your company to at least have a solid understanding of the tech you are working with.