15

I have installed the docker daemon on a Debian 8 machine. And after setting a value for "DOCKER_OPTS" within the file "/etc/default/docker" I wanted to check if after restarting the service the value was set properly.

Is there a command to display the current docker's configuration ?

Sabbane
  • 2,938
  • 4
  • 21
  • 27

1 Answers1

13

After some researches I found the following issue https://github.com/docker/docker/issues/9889 which explains that systemd ignores the configuration file /etc/default/docker. Therefore in my case "DOCKER_OPTS" is not set.

After editing the file /lib/systemd/system/docker.service it is possible to check that the value is set correctly with the command, mentioned by Adrian, ps aux | grep docker.

The other useful commands to check the installation version and system information are docker version and docker info.

Sabbane
  • 2,938
  • 4
  • 21
  • 27
  • 1
    I had a similar question (how to get the current value of the Insecure Registries setting) and the `docker info` command worked for this. – Steve Chambers Feb 19 '18 at 13:22
  • 1
    There should be a command like `docker info` that shows whatever is configured for the docker engine daemon at the time. I want a way to validate settings (not that they are present in a configuration file or environment variable). – leeman24 Jun 24 '19 at 15:21
  • I want to print the `log-driver` and `log-opts` values from /etc/docker/daemon.json to ensure they took. docker info shows the driver but not the opts. Which, means I would have to wait and monitor for a threshold to hit to ensure the settings took, `ls -lha /var/lib/docker/containers/**/*json.log`. – josephdpurcell Dec 01 '22 at 11:04