Docker copy images between hosts

Copying docker images (import/export) between hosts

Sometimes it's useful to export a local docker image to another host without going through a repository

docker save -o [path for generated tar file] [image name]

For example :

docker save -o mycool-container.tar ufasoli/mycool-container:1.0

You will then need to copy the saved .tar image to the target host by however mean suits you (FTP, USB, SCP)

Once the image copied to the target host import the image to the local docker

docker load -i [path to image tar file]

Like so :

docker load -i mycool-container.tar

Depending on the size of the image this can be a long operation, but once it's finished you should be able to see your image with the usual docker images command

No comments:

Post a Comment

Docker copy images between hosts

Copying docker images (import/export) between hosts Sometimes it's useful to export a local docker image to another host without going...