gpt4 book ai didi

docker - docker aufs到devicemapper docker容器和镜像迁移

转载 作者:行者123 更新时间:2023-12-02 19:38:44 24 4
gpt4 key购买 nike

我在Ubuntu上,将默认docker存储驱动程序从aufs更改为devicemapper。我在aufs上有一些docker镜像和容器。我从/ var / lib / docker备份了aufs存储文件。

如何在不丢失数据的情况下将aufs镜像和容器导入devicemapper存储镜像和容器?

最佳答案

您可以在更改存储驱动程序之前save imagesexport containers

docker save myImage1 > myImage1.tar
docker export myContainer1 > myContainer1.tar

然后,在更改了存储驱动程序之后,您必须先 load imagesimport containers
docker load -i myImage1.tar
docker import /path/to/myContainer1.tar

请注意,关于官方文档:

the docker export command does not export the contents of volumes associated with the container. If a volume is mounted on top of an existing directory in the container, docker export will export the contents of the underlying directory, not the contents of the volume.

Refer to Backup, restore, or migrate data volumes in the user guide for examples on exporting data in a volume.

关于docker - docker aufs到devicemapper docker容器和镜像迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41262869/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com