Monday, 3 August 2015

DOCKER_OPTS in /etc/default/docker ignored on Ubuntu

For some reason, in debian 8 and ubuntu 15.01 systemd is skipping the execution of /etc/default/docker.

How to fix?

Copy the original systemd service file to /etc/systemd/system/

sudo cp  /lib/systemd/system/docker.service /etc/systemd/system/

Edit file /etc/systemd/system/docker.service
...
[Service]
ExecStart=/usr/bin/docker -d -H fd:// $DOCKER_OPTS
...
EnvironmentFile=-/etc/default/docker
...
Then execute:
sudo systemctl daemon-reload
sudo systemctl restart docker
Verify that /etc/default/docker is loaded
ps auxwww | grep docker
root      4989  0.8  0.1 265540 16608 ?        Ssl  10:37   0:00 /usr/bin/docker -d -H fd:// --insecure-registry 

That's it.

Possibly Related Posts