-
-
Notifications
You must be signed in to change notification settings - Fork 4
Docker Service Daemon
Juan A. S edited this page Apr 15, 2018
·
5 revisions
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.