如何使用Docker save将本地映像备份到文件中? [英] How do I use Docker save to backup a local image to a file?

查看:173
本文介绍了如何使用Docker save将本地映像备份到文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想备份名为 tt 的Docker映像,以便将基本设备大小从10GB更改为15GB。

I want to backup my docker image, named tt, so I can change the base device size from 10 GB to 15 GB.

要执行此操作,我要首先备份本地映像。但是我遇到错误

To do this I want to backup my local image first. But I am getting an error

$ 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

tt 图片是从 quay.io/travisci/travis-ruby 创建的。我安装了一些软件包并将其提交到本地。

The tt image is created from quay.io/travisci/travis-ruby. I installed some packages and committed it locally.

推荐答案

再次提交容器,然后尝试将其保存在本地系统上:

Commit the container again and then try saving it on the local system:

docker commit [CONTAINER-ID]

然后尝试将其保存:

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

这篇关于如何使用Docker save将本地映像备份到文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆