【发布时间】:2018-12-13 01:25:39
【问题描述】:
我正在安装 docker 版本:
Docker version 18.03.1-ce, build 9ee9f40.
OS: centos 7
我想将默认 docker root 更改为 /var/some_path。
我发现三种方式:
-
在文件
/etc/sysconfig/docker中添加(不工作)OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false -H tcp://0.0.0.0:2375 -g /var/vms/docker'[centos@ip-172-31-1-225
当我重新加载并重新启动 docker 时,什么也没有发生。根目录为/var/lib/docker。
-
在
/etc/docker/daemon.json中添加(不起作用){ "图": "/var/vms/docker", “存储驱动程序”:“覆盖” }
它抱怨:
unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file:
图:(来自标志:/var/lib/docker,来自文件:/var/vms/docker),存储驱动程序:(来自标志:覆盖,来自文件:覆盖)
所以我从/etc/systemd/system/docker.service.d/execstart.conf 中删除了--graph=/opt/afp/docker --storage-driver=overlay。
之后当我重新加载并重新启动docker时
sudo systemctl daemon-reload
sudo systemctl restart docker
我收到错误:
Error starting daemon: error initializing graphdriver: overlay: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior. Reformat the filesystem with ftype=1 to enable d_type support. Backing filesystems without d_type support are not supported.
-
在
/etc/systemd/system/docker.service.d/execstart.conf中添加(不工作):ExecStart=/usr/bin/dockerd --graph=/var/lib/vms/docker --storage-driver=overlay
(同时删除步骤 2 中添加的 /etc/docker/daemon.json)
我得到同样的错误:
Error starting daemon: error initializing graphdriver: overlay: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior. Reformat the filesystem with ftype=1 to enable d_type support. Backing filesystems without d_type support are not supported.
注意(重要):当根路径 --graph=/var/lib/docker 时,一切正常。
【问题讨论】:
标签: docker centos docker-compose centos7 docker-swarm