What is the location of config file in Docker 1.9?

meallhour picture meallhour · Dec 14, 2015 · Viewed 21k times · Source

In the version 1.8 of Docker we could find the docker config file under /etc/sysconfig

However, after installing Docker 1.9 I cant see the docker config file under /etc/sysconfig

What is the new location of the config file??

Distribution: Centos 7.1

Answer

Matt picture Matt · Dec 22, 2015

It sounds like you have moved from the CentOS distributed docker to the docker.com docker-engine packages as CentOS hasn't moved to 1.9 yet.

The CentOS packages will make use of the /etc/sysconfig standard. Dockers packages will not. You will also miss out on the docker-storage-setup program RedHat built to deal with their unique storage requirements.

The systemd config in /usr/lib/systemd/system/docker.service will show you the difference:

Docker

[Service]
Type=notify
ExecStart=/usr/bin/docker daemon -H fd://
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576

CentOS

[Service]
Type=notify
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
Environment=GOTRACEBACK=crash
ExecStart=/usr/bin/docker daemon $OPTIONS \
          $DOCKER_STORAGE_OPTIONS \
          $DOCKER_NETWORK_OPTIONS \
          $ADD_REGISTRY \
          $BLOCK_REGISTRY \
          $INSECURE_REGISTRY
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
MountFlags=slave
TimeoutStartSec=1min
Restart=on-failure

So then, how do I configure the docker-engine installed docker service?

Docker have a page on setting up the systemd config. You can go either CentOS or Docker with your config

  • Docker - edit the docker-engine systemd config file /usr/lib/systemd/system/docker.service with your required options
  • Centos - copy the EnvironmentFile setup and then configure your options in /etc/sysconfig/docker.