Docker is a popular tool to containerize and share images. Recently we ported a POS system into a docker image and had to share it with a client before we setup a private registry. This is how we share the image from my dev machine to clients local server.

Dev Machine: Kubuntu, 22.04

docker save pos_web:latest | gzip > pos_web.tar.gz

You can export it to a regular tar file using the following command. Gzip just make the file smaller.

docker save -o pos_web.tar save pos_web:latest

You can then transfer the file to the client server. If you have ssh access to the server you can do so using a simple SCP command.

scp ./path/to/pos_web.tar.gz user@server:~/

The above command will transfer the file to the home folder.

Once the file is in the server you can load the image using the docker load command.

docker load < ./pos_web.tar.gz

This command will load an image or repository from a tar archive (even if compressed with gzip, bzip2, or xz) from a file or STDIN. It restores both images and tags. Source:

So no need to decompress before loading.

PS: Found this gem from the stackoverflow

Run all the above in a single command.

docker save <image> | bzip2 | ssh user@host docker load

or to see with progress bar

docker save <image> | bzip2 | pv | ssh user@host docker load