您现在的位置是: 首页 > 运维 迁移 Docker 目录
迁移 Docker 目录
2020-05-21 【运维】 2798人已围观 4705次浏览
简介迁移 Docker 目录
Docker 默认安装目录在 /var/lib/docker 下面,之后下载的镜像还有新建的 volume 都是基于这个目录下存储的(无法自定义镜像和 volume 的存储路径),长期如此就会导致默认磁盘空间满了,或者由于默认磁盘不是 SSD,性能上也是一个问题,所以最好是迁移 Docker 到其他磁盘,最好是迁移到 SSD 磁盘中。下面是迁移的步骤
首先运行命令,查看当前 Docker 的相关信息(在迁移之前,一定要先启动一次 Docker ,默认安装完之后是不会自动启动的,所以迁移之前一定要保证 Docker 已经启动过一次)
docker info
通过上面的命令可以看到 Docker 当前的路径
Docker Root Dir: /var/lib/docker
然后停止 Docker
systemctl stop docker
之后完整迁移 Docker 文件夹(实际迁移位置,根据自己机器来定)
mv /var/lib/docker /data/
建立软连(默认的启动还是去找的 /var/lib/docker 中的文件)
cd /var/lib
ln -s /data/docker/ docker
然后启动 Docker
systemctl start docker
重新查看 Docker Info
docker info
可以看到路径已经变更
Docker Root Dir: /data/docker
以上就是迁移 Docker 目录的完整步骤
很赞哦! (0)
上一篇:CentOS 安装 Docker
相关文章
- LNMP 手动更新 SSL 证书
- 自建Ngrok服务端
- docker mysql 导入 SQL 脚本
- ElasticSearch安装踩坑指南
- Docker 批量操作命令
- 【Docker】unauthorized: incorrect username or password
- sentinel directive while not in sentinel mode 问题解决
- Oracle ORA-12541:TNS:no listener错误解决方法
- linux下各文件夹的结构说明及用途介绍
- Redis 提示 MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk 解决方案
点击排行
- Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: ERR DISABLE You can't write or read against a disable instance
- Debian apt 使用国内镜像
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- 类 BASE64Decoder 程序包 sun.misc 找不到符号
- SpringBoot @NotBlank 不生效问题
- 记一次 Mybatis-Plus 自动填充无效问题解决
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- nuxt 项目完整部署方案
站长推荐
猜你喜欢
- win10 cmd下运行python命令弹出windows应用商店问题
- Linux 查看磁盘、磁盘分区、挂载磁盘、卸载磁盘操作
- RocketMQ 出现 sendDefaultImpl call timeout 问题
- SpringBoot 集成 Elasticsearch 7.8.1 出现错误 Factory method 'elasticsearchRestHighLevelClient' threw exception; nested exception is java.lang.NoSuchFieldError: IGNORE_DEPRECATIONS
- Zookeeper 找不到或无法加载主类 org.apache.zookeeper.server.quorum.QuorumPeerMain
- PHP 在执行 composer install 时出现提示 PHP Fatal error: Allowed memory size of XXXXXX bytes exhausted <...>
- 在更新python时出现dyld: Library not loaded: /usr/local/opt/libpsl/lib/libpsl.5.dylib,Reason: image not found错误解决方案
- 【代码片段】MySQL 查看数据库所有表注释
- SpringBoot 2.x 文件上传出现 The field file exceeds its maximum permitted size of 1048576 bytes
- SqlServer 查询包含指定字段的存储过程