Export and Import a Docker Image Between Nodes

Export and Import a Docker Image Between Nodes

Get Social!

docker-logoOne 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.

Copy MySQL Database to Another Server

Category : How-to

Get Social!

mysql-logoThe easiest way to do a one off move of a MySQL database from one server to another is to use the mysqldump utility. This utility will dump the entire database and it’s content to a file and which can then be imported it into the target database.

Before running the export, you should make sure you have enough free space to hold the database. The bigger the database, the more free space you will need for the SQL dump.

Run the below command to export your database from the source server. Replace [EXPORT_DATABASE] with the name of the database to export.

If required, move the SQL dump file to the target server. On the target server, run the below command to connect, create the database and import the data. Change [USERNAME] to the user you would like to connect as and [DATABASE_NAME] to the name of the databse where the dump file will be imported. The [DATABASE_NAME] will most likely be the same as on the source database however you are able to change it if required.

Visit our advertisers


Quick Poll

Do you use GlusterFS in your workplace?

Visit our advertisers