通过.tar包来实现镜像的一些列操作

备份

备份镜像到宿主机指定文件夹

  1. docker save -o ./my_hello_world.tar hello-world:latest

恢复

把本地镜像恢复到docker中。说白了就是使用本地镜像

docker load -i ./my_hello_world.tar