Failed to start Docker Application Container Engine

Hello Everybody,

I ran into an issue today.
After installing “docker-compose” the docker client does not start anymore.

-- Unit docker.service has begun starting up.
Jul 26 15:52:00 VM-BLUBU16CSS dockerd[2836]: 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://], fro
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: docker.service: Unit entered failed state.
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: docker.service: Failed with result 'exit-code'.
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: Stopped Docker Application Container Engine.
-- Subject: Unit docker.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has finished shutting down.
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: Closed Docker Socket for the API.
-- Subject: Unit docker.socket has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has finished shutting down.
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: Stopping Docker Socket for the API.
-- Subject: Unit docker.socket has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has begun shutting down.
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: Starting Docker Socket for the API.
-- Subject: Unit docker.socket has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has begun starting up.
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.socket has finished starting up.
--
-- The start-up result is done.
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: docker.service: Start request repeated too quickly.
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Jul 26 15:52:00 VM-BLUBU16CSS systemd[1]: docker.socket: Unit entered failed state.

The configuration is as follow:
/etc/docker/daemon.json
{
“debug”: true,
“insecure-registries”: [“nexus-domain.com:10000” ,“10.100.x.x:10000/”],
“hosts”: [“tcp://0.0.0.0:2376”, “unix:///var/run/docker.sock”],
“tls”: false
}

The docker service would be run if I take off the entrie “unix:///var/run/docker.sock”
But then, all of my container are disappeared. So this is not a option.

Thanks

Version

Client:
Version: 17.06.0-ce
API version: 1.30
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:23:31 2017
OS/Arch: linux/amd64

I would be happy if anybody knows an solution.

Same issue here. Seems the json conf can’t override the systemd one, which is a bug, IMHO.

I’ve worked around using

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 --

The post above is correct except for the port number.
It should be 2376 instead of 2736.
This took me a while to find =/