> vim /etc/docker/daemon.json
{
"hosts": [
"tcp://0.0.0.0:2375",
"unix:///var/run/docker.sock"
]
}
> systemctl restart docker.service
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
> systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2017-02-06 12:16:57 CST; 13s ago
Docs: https://docs.docker.com
Process: 21952 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 21952 (code=exited, status=1/FAILURE)
Feb 06 12:16:57 xsl systemd[1]: Starting Docker Application Container Engine...
Feb 06 12:16:57 xsl dockerd[21952]: 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: hosts: (from flag: [fd://], from file: [tcp://0.0.0.0:2375, unix:///var/run/docker.socket])
Feb 06 12:16:57 xsl systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Feb 06 12:16:57 xsl systemd[1]: Failed to start Docker Application Container Engine.
Feb 06 12:16:57 xsl systemd[1]: docker.service: Unit entered failed state.
Feb 06 12:16:57 xsl systemd[1]: docker.service: Failed with result 'exit-code'.
> vim /lib/systemd/system/docker.service # Ubuntu的路径; CentOS 的路径为: /usr/lib/systemd/system/docker.service
# ...省略
# 关键行
ExecStart=/usr/bin/dockerd -H fd://
# ...省略
欢迎光临 黑帽联盟 (https://bbs.cnblackhat.com/) | Powered by Discuz! X2.5 |