Share Docker Images as Files
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
|
|
You can export it to a regular tar file using the following command. Gzip just make the file smaller.
|
|
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.
|
|
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.
|
|
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: https://docs.docker.com/engine/reference/commandline/load/
So no need to decompress before loading.
PS: Found this gem from the stackoverflow
Run all the above in a single command.
|
|
or to see with progress bar
|
|