Docker Community Forums

Share and learn in the Docker community.

How to copy (move) old images and containers from virtualbox


(Sluchainiyznak) #1

Hello. Please explain, how to move exists images and containers from virtualbox to new docker for mac VM?


Docker for Mac install offers to copy containers, but are missing
(Dsapala) #2

For images you would first make sure that you’re using virtualbox with docker and use “docker save” to save your images to tar files. You would then turn off virtualbox and turn on docker for mac and make sure you’re now using that with docker and then “docker load” them.


(Sluchainiyznak) #3

Thank you for your answer, but question about containers is open! Here https://beta.docker.com/docs/mac/getting-started/#what-to-know-before-you-install doc say It copies containers and images from your local default machine (if one exists) to the new Docker for Mac xhyve VM


(Ingo Z) #4

Agreed. https://beta.docker.com/docs/mac/docker-toolbox/ describes

Installing Docker for Mac does not affect machines you created with
Docker Machine. The install offers to copy containers and images from
your local default machine (if one exists) to the new Docker for Mac xhyve VM. If chosen, content from default is copied to the new Docker for Mac xhyve VM, and your original default machine is kept as is.

This wasn’t offered for me and maybe it’s just not ready yet however instructions how to do this manually would help and even if it is really in the end only docker save/load.


(Pascal Brandt) #5

+1

My Virtualbox VM is not called default, so nothing was copied. It would be great if there were some instructions on how to copy stuff from old VMs to xhyve.


(Ingo Z) #6

Mine actually is called default… :confused:


(Villuppi) #7

When istalling it should be asking if you want to copy your existing images and containers. I noticed that the progresbar is on 0% all the time when copying. But it works. I made clean install with beta 13.1 installer.


(Ingo Z) #8

Exactly. It should but it didn’t. And is there a way to kick this off manually


(Andrewpsy) #9

During the “Docker for Mac” installation, I wasn’t offered to copy/move machine/images.
My docker machine is called default but uses vmwarefusion as its driver.
I believe using vmwarefusion instead of virtualbox as machine’s driver is the problem.


(Patrick McElwee) #10

+1 I would love to know how to kick this off manually (my VM is called ‘docker-vm’, not ‘default’).


(Marko) #11

You can use https://gist.github.com/mmrko/78a071d0ff2062cb199a852e2469586f to manually grab images from your Docker Machine and load them into your new Docker for Mac setup. The rundown would be something as follows:

  1. Point the Docker daemon to your Docker Machine: eval "$(docker-machine env your-docker-machine-name-goes-here)"
  2. Grab the images from your Docker Machine (by running the script referred to above): ./save-load-images.sh save ./my-images
  3. (Run docker-machine upgrade your-docker-machine-name-goes-here if you see a prompt saying the Docker client and server versions do not match)
  4. Make the Docker CLI point back to your newly installed Docker for Mac by unsetting the DOCKER env variables (which were set by the eval in step 1.)
  5. Load the images into Docker for Mac: ./save-load-images.sh load ./my-images