[go: up one dir, main page]

Skip to content

Docker Service Daemon

Juan A. S edited this page Apr 15, 2018 · 5 revisions

Docker Service/Daemon

To allow ProxyChanger to change Docker Service/Daemon settings, it has to have permissions to modify some configuration files, and to run commands as sudo. To achieve this, the system needs to be configured like this:

sudo mkdir -p /etc/systemd/system/docker.service.d
sudo chmod 755 /etc/systemd/system/docker.service.d
sudo touch /etc/systemd/system/docker.service.d/http-proxy.conf
sudo chmod 640 /etc/systemd/system/docker.service.d/http-proxy.conf
sudo chown ${USER}:docker /etc/systemd/system/docker.service.d/http-proxy.conf
cat << EOF | sudo EDITOR='tee' visudo -f /etc/sudoers.d/docker
${USER} ALL=(root) NOPASSWD: /bin/systemctl daemon-reload
${USER} ALL=(root) NOPASSWD: /bin/systemctl restart docker.service
EOF

Please note that whenever the proxy changes, the Docker daemon will be restarted (this is not configurable yet). If you want your containers not to be stopped because of the restart, you should enable the live-restore feature; more info here.

Clone this wiki locally