解决方法0:
$ ps axf | grep docker | grep -v grep | awk '{print "kill -9 " $1}' | sudo sh
$ nohup dockerd &
解决方法1:
$ ps axf | grep docker | grep -v grep | awk '{print "kill -9 " $1}' | sudo sh
$ sudo systemctl start docker
解决方法2:
Same issue here. Seems the json conf can’t override the systemd one, which is a bug, IMHO.
In summary
First, delete the hosts entry from the json file.
Create a conf file in /etc/systemd/system/docker.service.d, e.g
/etc/systemd/system/docker.service.d/hosts.conf
Configure the start with the extra options. In my case, ubuntu with systemd, it uses file discovery sockets (fd://), and I added a tcp one.
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2736
Note the empty ExecStart. Seems to be an issue with how systemd declares units.
Save, reload
systemctl daemon-reload
and restart the service
systemctl restart docker.service
You should see the new settings
# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/docker.service.d
└─hosts.conf
Active: active (running) since Thu 2017-07-27 11:45:54 PDT; 3s ago
Docs: https://docs.docker.com
Main PID: 20482 (dockerd)
Tasks: 18 (limit: 4915)
Memory: 15.3M
CPU: 351ms
CGroup: /system.slice/docker.service
├─20482 /usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2736
└─20489 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --