【发布时间】:2020-04-11 10:10:23
【问题描述】:
预期行为
I would expect to see traffic trying to hit my proxy server when docker grabs images from docker hub.
实际行为
I see traffic trying to go directly to docker hub and is not using the proxy specified in the environment variable
重现行为的步骤
设置代理变量并确保它设置为:
echo $HTTP_PROXY
通过指定 HTTP_PROXY 变量尝试使用 golang 运行容器
docker run -e HTTP_PROXY golang:1.9
我也尝试通过在此处创建文件来设置 systemd 配置: /etc/systemd/system/docker.service.d/http-proxy.conf 然后运行 systemctl daemon-reload 然后 service docker restart
docker 版本的输出:
Docker version 19.03.5, build 633a0ea838
Output of docker info:
docker info
Client:
Debug Mode: false
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 19.03.5
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.4.0-170-generic
Operating System: Ubuntu 16.04.6 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 992.1MiB
Name: cmsp-sand1
ID: BPFR:QNXD:WVD5:5TXT:AXDQ:YNXT:APCN:U4XS:7OTZ:73NP:JW34:KNSM
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: No swap limit support
Additional environment details (AWS, VirtualBox, physical, etc.)
This is running on a virtualbox vagrant VM (ubuntu16.04.6) this nested inside a hyper-v VM running ubuntu 18.04.1
【问题讨论】:
标签: docker