Skip to content

docker-ce-cli 5:19.03.0 doesn't honor proxy variables #735

@yaunj

Description

@yaunj
  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

Specifying http and/or https proxy via the environment and running the docker client to e.g. list stacks on a remote docker swarm manager should use the proxy to contact the docker host.

Actual behavior

The docker client tries to contact the docker host directly.

Steps to reproduce the behavior

With a squid proxy running on proxy.mycorp.tld port 3128, and a swarm manager running with TLS on docker.mycorp.tld, the following command should list the running stacks:

https_proxy=http://proxy.mycorp.tld:3128 docker -H docker.mycorp.tld:2376 --tlsverify stack ls

When running docker-ce-cli version 19.03.0, the client contacts the docker host directly. With docker-ce-cli version 18.09.8, the proxy is used.

I also tried setting the proxy in ~/.docker/config.json, but this doesn't work either.

Downgrading docker-ce-cli mitigates the issue.

Output of docker version:

Docker version 19.03.0, build aeac9490dc

Output of docker info on the machine where the client is running:

Containers: 18
 Running: 0
 Paused: 0
 Stopped: 18
Images: 7783
Server Version: 19.03.0
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: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.0-9-amd64
Operating System: Debian GNU/Linux 9 (stretch)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.68GiB
Name: REDACTED
ID: 7B65:4YIC:FZD2:547G:PR3I:HGEO:FUGI:DLY2:O4ST:BXLC:FLLE:A3A2
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
HTTP Proxy: http://REDACTED3128
HTTPS Proxy: http://REDACTED:3128
No Proxy: localhost,127.0.0.1
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Output of docker info on the swarm manager:

Server:
 Containers: 19
  Running: 12
  Paused: 0
  Stopped: 7
 Images: 53
 Server Version: 19.03.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: syslog
 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: active
  NodeID: sp9w3l9ct7etb2eyjjmz969kc
  Is Manager: true
  ClusterID: urayfbd0t73vphw94vzqdlxsa
  Managers: 3
  Nodes: 3
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 10
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: REDACTED
  Manager Addresses:
   REDACTED
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.9.0-9-amd64
 Operating System: Debian GNU/Linux 9 (stretch)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 15.68GiB
 Name: REDACTED
 ID: DTZP:C3IT:RSVL:4YR5:3WNM:ROQP:OODD:36N7:LLJH:HR4B:MYVK:Q2AA
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: REDACTED:3128
 HTTPS Proxy: REDACTED:3128
 No Proxy: localhost,127.0.0.1,REDACTED
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.)

The swarm cluster tested is running on VMware. The docker clients are running on both virtual and physical machines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions