Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更改Docker存储目录 #57

Open
woodongwong opened this issue Apr 23, 2021 · 1 comment
Open

更改Docker存储目录 #57

woodongwong opened this issue Apr 23, 2021 · 1 comment
Labels

Comments

@woodongwong
Copy link
Owner

systemctl stop docker
vi /lib/systemd/system/docker.service
# 找到 
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
# 修改成
ExecStart=/usr/bin/dockerd -H fd:// -g /new/path/docker --containerd=/run/containerd/containerd.sock
mv /var/lib/docker /new/path/docker
systemctl daemon-reload
systemctl start docker

参考:

https://linuxconfig.org/how-to-move-docker-s-default-var-lib-docker-to-another-directory-on-ubuntu-debian-linux

@woodongwong
Copy link
Owner Author

更新docker后,/lib/systemd/system/docker.service 会恢复成默认,需要重新设置。

另一种思路:将/var/lib/docker目录软连到/new/path/docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant