Proxy Settings for Docker and Nix Daemons
Docker Daemon Proxy
The Docker daemon checks environment variables in its startup environment.
Or you can
According to the official Docker documentation
Create a directory and configuration file for the Docker service:
1 | sudo mkdir -p /etc/systemd/system/docker.service.d/ |
Create
/etc/systemd/system/docker.service.d/http-proxy.conf with
your proxy settings:
1 | [Service] |
Apply the configuration changes:
1 | sudo systemctl daemon-reload |
Check that the environment variables are properly set:
1 | sudo systemctl show --property=Environment docker |
Nix Daemon Proxy
According to the Nixos CN documentation
1 | sudo mkdir -p /run/systemd/system/nix-daemon.service.d/ |
Create
/run/systemd/system/nix-daemon.service.d/override.conf with
your proxy settings:
1 | sudo tee /run/systemd/system/nix-daemon.service.d/override.conf << EOF |
Apply the configuration changes:
1 | sudo systemctl daemon-reload |
PS
- The
NO_PROXYvariable should include local addresses and internal services that shouldn't go through the proxy - Different proxy protocols may be required (HTTP, HTTPS, SOCKS5) depending on your network setup