Docker- Export and Import a Docker Image Between Nodes

One of the driving forces behind Docker is to create a consistent environment across all Docker enabled machines and to create portable templates, or images, which can be ran on any Docker enabled server.
It would, therefore, make perfect sense that Docker have made it very easy for us to export a running container and re-import it on another Docker server.
Lets assume, for this example, that you have a running container that you would like to move to another host. The summary of the process is to save the container to an image, save it to a tar file, move it to your new host and load the image into the new docker server.
Find the ID of the container that you would like to move.
I’m going to use the above 3a09b2588478 ID for this example.
Commit your changes and save the container to an image called mynewimage.
Save the mynewimage image to a tar file. I will use the /tmp/ directory to save the image but you could easily use a NFS share to make it easier to move the completed tar file.
Copy the mynewimage.tar file to your new Docker instance using whatever method works in your environment, for example FTP, SCP, etc.
Run the docker load command on your new Docker instance and specify the location of the image tar file.
Finally, run the docker images command to check that the image is now available.

Comentarios