Docker 数据迁移¶
概要: 以RHEL 8.5平台为例,迁移Docker数据到新路径位置
创建时间: 2022.09.19 23:34:01
更新时间: 2023.08.01 00:02:02
确定Docker数据位置¶
Bash | |
---|---|
/var/lib/docker
停掉Docker服务¶
Bash | |
---|---|
使用rsync迁移数据¶
rsync
is a fast and versatile command-line utility for synchronizing files and directories between two locations over a remote shell, or from/to a remote Rsync daemon. It provides fast incremental file transfer by transferring only the differences between the source and the destination. Rsync can be used for mirroring data, incremental backups, copying files between systems, and as a replacement forscp
,sftp
, andcp
commands.
确保 rsync
工具已经安装
Bash | |
---|---|
Bash | |
---|---|
Bash | |
---|---|

更新Docker配置¶
新建或编辑Docker配置文件
Bash | |
---|---|
重启Docker服务¶
重启Docker服务
确认迁移成功¶
首先确认新的位置已被正确加载
Bash | |
---|---|

接下来检查Docker各个容器是否正常工作,最后移除旧的Docker数据
Bash | |
---|---|