docker修改默认目录

Published on with 0 views and 0 comments

修改默认目录

  1. mkdir -p /data/docker/lib
  2. systemctl stop docker.service
  3. rsync -avz /var/lib/docker/ /data/docker/lib/
  4. mkdir -p /etc/systemd/system/docker.service.d/
  5. vim /etc/systemd/system/docker.service.d/devicemapper.conf
  6. 创建文件:
  7. [Service]
    ExecStart=
    ExecStart=/usr/bin/dockerd --graph=/data/docker/lib/
  8. systemctl daemon-reload
  9. systemctl restart docker
  10. docker info | grep "Dir"

查看占用

docker system df

清除空间

docker system prune


标题:docker修改默认目录
作者:fyzzz
地址:https://fyzzz.cn/articles/2021/01/15/1610676852740.html