0

I had observe on the same OS (ubuntu 16.04), different machines, that if I run sudo systemctl status docker, then I have different results concerning the location of docker.service, more exactly on one machine I have:

   docker.service - Docker Application Container Engine
      Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
      Active: active (running) 
....
      CGroup: /system.slice/docker.service
              ├─1411 /usr/bin/dockerd -H unix://
and on the other machine I have:
   docker.service - Docker Application Container Engine
      Loaded: loaded (/etc/systemd/system/docker.service; enabled; vendor preset: enabled)
      Active: active (running) 
....
      CGroup: /system.slice/docker.service
              ├─1411 /usr/bin/dockerd -H fd://
What is the cause for different location of docker.service ? Thanks
  • 1
    What exactly is your question here? – hardillb Jan 10 at 12:54
1

The default configuration file for the docker daemon is located in /lib/systemd/system/docker.service, while custom configuration can be placed in /etc/systemd/system/docker.service or in /etc/systemd/system/docker.service.d/ folder, which overrides the default.

Also see this and this.

From the docs:

There are a number of ways to configure the daemon flags and environment variables for your Docker daemon.

The recommended way is to use a systemd drop-in file. These are local files in the /etc/systemd/system/docker.service.d directory. This could also be /etc/systemd/system/docker.service, which also works for overriding the defaults from /lib/systemd/system/docker.service.

Note, that this is from an old version, that section changed in current version saying the following:

The recommended way is to use the platform-independent daemon.json file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.