中文版本:拷贝docker镜像,转移到其他宿主机
In actual work, there is a case of copying docker images to other hosts, usually through pull, but that requires a repo.
Can we package files directly and transfer the images to other hosts?
Use docker images
to list the images on the local host:
$ docker images
Save the steem-22.2 image of the local host as the file steem-22.2.tar in the current directory, and then copy this file to other hosts
sudo docker save -o steem-22.2 ./steem-22.2.tar
Executed on the other host where the docker image needs to be restored (the other host must have docker installed)
sudo docker load < steem-22.2.tar
The prompt steem-22.2 indicates that the loading is successful, and you can continue to use the docker image.
When saving a docker image, you can save multiple images as one file, and export multiple images at the same time.