среда, 12 октября 2016 г.

Docker, передача параметров демону в ubuntu / debian

Источник

After a look around at the configuration files in /lib/systemd/system/, it seems that the Docker configuration file (/lib/systemd/system/docker.service) is not using /etc/default/docker at all.

  The problem is solved by adding an EnvironmentFile directive and modifying the command line to include the options from the file, e.g.
 
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target docker.socket
Requires=docker.socket

[Service]
EnvironmentFile=-/etc/default/docker
ExecStart=/usr/bin/docker -d $DOCKER_OPTS -H fd://
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity

[Install]
WantedBy=multi-user.target 
 
You have to edit /lib/systemd/system/docker.service to look like the above, 
run systemctl daemon-reload, and then restart the Docker service.