Sending docker images manually

Dawid Laszuk published on
1 min, 132 words

Sometimes we want to send a docker image to dev or staging environment. That's for testing a small change, for example extra logs for debuging. One could push the image to a registry with some throw away tag, e.g. dev, and then pull it on the other side. But that's unnecessary push to and pull from the registry. Instead, we can save the image to a file and then load it from the file.

# Save image locally
docker save -o my_image.tar my_image:latest
# Load image from a file
docker load -i my_image.tar

If we can ssh into the remote machine then we can easily send the image over.

docker save my_image:latest | gzip | ssh user@remote | docker image load

Now the image my_image:latest is available on the remote machine. Job done easily.