Improve the docker configuration instruction

I ran into the problem that if you configure the daemon according to the instructions Getting Started , then after the docker update all settings are lost.

It is necessary to change the recommendation from editing the file /lib/systemd/system/docker.service to creating file override.conf in directory /etc/systemd/system/docker.service.d/

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -D -H tcp://127.0.0.1:2375

After updating the docker, the settings will not be lost.

Links: Using systemd to control the Docker daemon

Hi @maruschin, This is a very useful suggestion, thank you, and we will update the documentation!

Best,
Tobias

1 Like

Hi,
The standard docker installation went fine and docker ran fine butafter this modification docker will not restart anymore.
Any idea what’s the problem?

On ServerFault, Routhinator recommends:

Never edit the docker service script (or any service script) directly. SystemD has a differential editing feature built in. Use systemctl edit docker.service and systemctl will create an new file with your edits. This prevents an update from wiping your changes. SystemD will merge the two files at runtime. Good document here: digitalocean.com/community/tutorials/… – [Routhinator] [Sep 20 '17 at 2:07]

This is a less error-prone approach and worked for me when directly creating the override file did not.