Conflict between default -H fd://
systemd config and daemon.json hosts
config #25471
Open
Description
opened on Aug 6, 2016
Using hosts
configuration in daemon.json
file is conflicting with the default systemd -H fd://
config.
Of course, I can edit the /lib/systemd/system/docker.service
file or duplicate it as /etc/systemd/system/docker.service
or even add a complementary config file in /etc/systemd/system/docker.service.d/
to change the ExecStart
command.
But then it would imply to maintain this change instead of simply use the daemon.json
file to customize daemon options.
Output of docker version
:
Client:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 22:00:43 2016
OS/Arch: linux/amd64
Server:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 22:00:43 2016
OS/Arch: linux/amd64
Output of docker info
:
Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 1
Server Version: 1.11.2
Storage Driver: overlay
Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge null host
Kernel Version: 4.4.0-31-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 992.5 MiB
Name: lsphproxy1
ID: GF3H:AK3M:7MPZ:WNK5:47KQ:VLTL:EBNM:HMBW:PR7K:NQ47:ODXF:3OG6
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Cluster store: etcd://127.0.0.1:2379
Cluster advertise: 172.25.0.2:2376
daemon.json:
{
"cluster-advertise": "enp0s8:2376",
"cluster-store": "etcd://127.0.0.1:2379",
"hosts": [
"tcp://127.0.0.1:2375",
"tcp://172.25.0.2:2375"
],
"storage-driver": "overlay"
}
Steps to reproduce the issue:
- Use the default systemd
docker.service
from apt package - Add
hosts
configuration in/etc/docker/daemon.json
sudo systemctl restart docker
Describe the results you received:
Docker failed to start.
docker[14447]: 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://127.0.0.1:2375 tcp://172.25.0.2:2375])
Describe the results you expected:
Docker started.
Activity