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
I was also unable to get it to work on Debian 11 without the workaround in https://gist.github.com/styblope/dc55e0ad2a9848f2cc3307d4819d819f#gistcomment-3482239 (directly editing the docker.service file). It seems that on Debian 11, the
docker.service.d/override.conf
doesn't actually get read, so you just have to edit the docker.service.I also used
ExecStart=/usr/sbin/dockerd --containerd=/run/containerd/containerd.sock --tls=false
to avoid the very strong and important complaints: