See this issue.
Docker best practise to Control and configure Docker with systemd.
-
Create
daemon.json
file in/etc/docker
:{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
-
Add
/etc/systemd/system/docker.service.d/override.conf
[Service] ExecStart= ExecStart=/usr/bin/dockerd
-
Reload the systemd daemon:
systemctl daemon-reload
-
Restart docker:
systemctl restart docker.service
Thank you. This override.conf trick worked nicely for me. I used daemon.json to supply my TLS configuration as well as listen on 2376. Giving it nothing except a reference to daemon.json feels like a hack to avoid the hosts conflict.. but it works. Thanks again @webzakimbo
root@mnretrogamer029:~# cat /etc/docker/daemon.json
{
"data-root": "/mnt/dietpi_userdata/docker-data",
"log-driver": "journald",
"log-level": "warn",
"debug": false,
"hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2376"],
"tlscacert": "/etc/docker/certs.d/ca.pem",
"tlscert": "/etc/docker/certs.d/server-cert.pem",
"tlskey": "/etc/docker/certs.d/server-key.pem",
"tlsverify": true
}