Zum Inhalt

Docker Proxy‑Konfiguration

Um Docker hinter einem HTTP/HTTPS‑Proxy zu betreiben, führe die folgenden Schritte aus: Erstelle das Systemd und bearbeite die Proxy‑Konfiguration:

mkdir -p /etc/systemd/system/docker.service.d
nano /etc/systemd/system/docker.service.d/http-proxy.conf

Inhalt von http-proxy.conf:

[Service]
Environment="HTTP_PROXY=http://$proxyip:$proxyport"
Environment="HTTPS_PROXY=http://$proxyip:$proxyport"
Environment="NO_PROXY=172.18.0.0/16"
ExecStart=
ExecStart=/usr/bin/dockerd

Lade Systemd neu und starte Docker:

systemctl daemon-reload
systemctl restart docker

Konfiguriere den Docker‑CLI‑Proxy für den User:

mkdir -p /$user/.docker
nano /$user/.docker/config.json

Inhalt von config.json:

    {
      "proxies": {
        "default": {
          "httpProxy":  "http://$proxyip:$proxyport",
          "httpsProxy": "http:/$/proxyip:$proxyport",
          "noProxy":    "172.18.0.0/16"
        }
      }
    }