Change Docker root directory /var/lib/docker to another location
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 45/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- docker, linux
- 领域
- devops, infrastructure
调研方向
Review the repository's existing organization for programming tips, then verify the Docker commands and storage-driver references in the issue against the linked Docker documentation. Done means the relocation instructions are added in the project's established format and clearly cover stopping, moving, reconfiguring, restarting, and filesystem limitations.
由索引模型根据 Issue 内容生成。
描述
By default, Docker stores most of its data inside the /var/lib/docker directory on Linux systems. There may come a time when you want to move this storage space to a new location. For example, the most obvious reason might be that you’re running out of disk space.
1.How to edit systemd to accommodate new Docker location? stop the service, update config, and restart
$sudo systemctl stop docker.service
$sudo systemctl stop docker.socket
$sudo vim /lib/systemd/system/docker.service
The line we need to edit looks like this:
ExecStart=/usr/bin/dockerd -H fd://
Edit the line by putting a -g and the new desired location of your Docker directory. When you’re done making this change, you can save and exit the file.
# for old docker
ExecStart=/usr/bin/dockerd -g /mnt/data/docker/ -H fd://
# for newer versions
ExecStart=/usr/bin/dockerd --data-root /mnt/data/docker/ -H fd://
2.How to move your Docker installation to a new location?
sudo mkdir -p /data/docker
sudo rsync -aqxP /var/lib/docker/ /data/docker
start docker:
$ sudo systemctl daemon-reload
$ sudo systemctl start docker
Note, if you get error of:
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
It may caused by File System not supported by docker. For my case, when I try to save docker data to NAS driver, it failed. For local driver, it works.
The docker data should be stored on a supported backing filesystem as mentioned here:
https://docs.docker.com/engine/storage/drivers/select-storage-driver/#supported-backing-filesystems
- 主要语言
- Python
- 星标
- 5
- 派生
- 2
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
davideuler/programming-tips 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 35/100
-
难度 2/5 1-3 小时 新手友好度 35/100
-
难度 1/5 1 小时以内 新手友好度 35/100
-
难度 2/5 1-3 小时 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 35/100
查看 davideuler/programming-tips 的全部 Issue
相似的 Issue
-
good first issue
难度 2/5 1-3 小时 新手友好度 85/100
btclib-org/btclib-node#1955 ·
维护者通常 1 天内回复
-
documentation v0.9.2
难度 2/5 半天 新手友好度 72/100
khuisman/mcp-gee-sweet#1033 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
ossf/cve-bin-tool#5966 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 2 天内回复
-
write_iceberg ignores the table's write.parquet.compression-codec property可能已有人在做 @YuangGao 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
Eventual-Inc/Daft#7606 ·
维护者通常 1 天内回复