در آدرس
/etc/systemd/system/docker.service.d
دو فایل http-proxy.conf و https-proxy.conf را ایجاد کردم و محتویاتشان:
[Service]
Environment="http_proxy=127.0.0.1:8118"
[Service]
Environment="https_proxy=127.0.0.1:8118"
در ادرس
/etc/systemd/system
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd
خروجی دستورات
cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=19.04
DISTRIB_CODENAME=disco
DISTRIB_DESCRIPTION="Ubuntu 19.04"
NAME="Ubuntu"
VERSION="19.04 (Disco Dingo)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 19.04"
VERSION_ID="19.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=disco
UBUNTU_CODENAME=disco
docker --version
Docker version 18.06.1-ce, build e68fc7a
curl --proxytunnel --proxy 127.0.0.1:8118 ipinfo.io
ip": "199000020200",
"hostname": "tor24.quintex.com",
"city": "San Angelo",
"region": "Texas",
"country": "US",
"loc": "31.4638,-000.0000",
"org": "AS62744 Quintex Alliance Consulting",
"postal": "76902",
"readme": "https://ipinfo.io/missingauth"
curl --socks5 127.0.0.1:9050 ipinfo.io
"ip": "46.000.000.000",
"hostname": "tor-exit.artikel10.org",
"city": "",
"region": "",
"country": "DE",
loc": "51.000,9.4200",
"org": "AS28753 Leaseweb Deutschland GmbH",
"readme": "https://ipinfo.io/missingauth"
export http_proxy=127.0.0.1:8118;curl --proxytunnel ipinfo.io
"ip": "199.000.000.00",
"hostname": "tor24.quintex.com",
"city": "San Angelo",
"region": "Texas",
"country": "US",
"loc": "31.4638,-000.0000",
"org": "AS62744 Quintex Alliance Consulting",
"postal": "76900",
"readme": "https://ipinfo.io/missingauth"
export https_proxy=127.0.0.1:8118;curl --proxytunnel -I https://index.docker.io/v1/search?q=ubuntu
HTTP/1.0 200 OK
HTTP/1.1 405 Method Not Allowed
Content-Type: application/json
Date: Mon, 19 Aug 2019 10:14:48 GMT
Content-Length: 38
Strict-Transport-Security: max-age=31536000