我正在CentOS7中运行docker。
我想将基本目录从
我找到了官方网站的这篇指南,但不知道如何应用到我的情况。
我只需在
下面是
那么我该如何解决这个问题呢?(同时我想知道当我只运行
========= 编辑 ===================
我的当前docker
我所做的唯一更改是
我想将基本目录从
/var/lib/docker
更改为/data/docker
。我找到了官方网站的这篇指南,但不知道如何应用到我的情况。
我只需在
/etc/docker/
新建daemon.json
文件。然后当我尝试运行守护进程时出现错误。下面是
systemctl status -l docker.service
的输出。● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-04-27 15:07:41 KST; 47s ago
Docs: https://docs.docker.com
Process: 42547 ExecStart=/usr/bin/dockerd (code=exited, status=1/FAILURE)
Main PID: 42547 (code=exited, status=1/FAILURE)
Apr 27 15:07:41 DCSF-DEV08 systemd[1]: Starting Docker Application Container Engine...
Apr 27 15:07:41 DCSF-DEV08 dockerd[42547]: unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives don't match any configuration option: default-ulimits
Apr 27 15:07:41 DCSF-DEV08 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Apr 27 15:07:41 DCSF-DEV08 systemd[1]: Failed to start Docker Application Container Engine.
Apr 27 15:07:41 DCSF-DEV08 systemd[1]: Unit docker.service entered failed state.
Apr 27 15:07:41 DCSF-DEV08 systemd[1]: docker.service failed.
那么我该如何解决这个问题呢?(同时我想知道当我只运行
systemctl start docker
而没有/etc/docker/daemon.json
时,守护进程的默认设置是什么)========= 编辑 ===================
我的当前docker
daemon.js
。{
"api-cors-header": "",
"authorization-plugins": [],
"bip": "",
"bridge": "",
"cgroup-parent": "",
"cluster-store": "",
"cluster-store-opts": {},
"cluster-advertise": "",
"debug": true,
"default-gateway": "",
"default-gateway-v6": "",
"default-runtime": "runc",
"default-ulimits": {},
"disable-legacy-registry": false,
"dns": [],
"dns-opts": [],
"dns-search": [],
"exec-opts": [],
"exec-root": "",
"fixed-cidr": "",
"fixed-cidr-v6": "",
"graph": "/data/docker",
"group": "",
"hosts": [],
"icc": false,
"insecure-registries": [],
"ip": "0.0.0.0",
"iptables": false,
"ipv6": false,
"ip-forward": false,
"ip-masq": false,
"labels": [],
"live-restore": true,
"log-driver": "",
"log-level": "",
"log-opts": {},
"max-concurrent-downloads": 3,
"max-concurrent-uploads": 5,
"mtu": 0,
"oom-score-adjust": -500,
"pidfile": "",
"raw-logs": false,
"registry-mirrors": [],
"runtimes": {
"runc": {
"path": "runc"
},
"custom": {
"path": "/usr/local/bin/my-runc-replacement",
"runtimeArgs": [
"--debug"
]
}
},
"selinux-enabled": false,
"storage-driver": "",
"storage-opts": [],
"swarm-default-advertise-addr": "",
"tls": true,
"tlscacert": "",
"tlscert": "",
"tlskey": "",
"tlsverify": true,
"userland-proxy": false,
"userns-remap": ""
}
我所做的唯一更改是
graph
,因为我只想更改根目录。(我想将其他内容设置为默认值。default
表示与systemctl start docker
相同的配置。)
/etc/docker/daemon.json
中放了什么? - kstromeiraos