如何使用docker save来备份本地映像文件?

嗨,我想备份我的docker图像吨,所以我可以将基础设备的大小从10GB改为15GB。

要做到这一点我想先备份我的本地图像。 但我得到一个错误

$ sudo docker save -o tt.tar.gz tt Error response from daemon: could not verify layer data for: sha256:xxxxx. This may be because internal files in the layer store were modified. Re-pulling or rebuilding this image may resolve the issue 

我的图片:

 $ sudo docker images REPOSITORY TAG IMAGE ID CREATED SIZE tt latest ced69d804781 13 minutes ago 9.186 GB quay.io/travisci/travis-ruby latest e41062702ee0 2 years ago 5.782 GB 

我的容器:

 $ sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f6ce7cf223b3 quay.io/travisci/travis-ruby "/bin/bash" 37 hours ago Up 22 minutes 22/tcp travis 

图像是从quay.io/travisci/travis-ruby创build的,我安装了一些软件包并在本地提交。

你没有标签名称testing的图像。 尝试 最新的做法:

 docker save -o tt.tar.gz tt:latest 

或者你也可以这样做:

 docker save tt:latest > tt.tar 

希望它会帮助!

再次提交conatiner,然后尝试将其保存在本地系统中

 docker commit [CONTAINER-ID] 

然后尝试保存它:

 docker save -o tt.tar.gz tt:latest 

希望它会帮助!