Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker swarm stack with http_proxy #41669

Open
ScottGuymer opened this issue Nov 13, 2020 · 1 comment
Open

Docker swarm stack with http_proxy #41669

ScottGuymer opened this issue Nov 13, 2020 · 1 comment
Labels
area/stack kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. version/19.03

Comments

@ScottGuymer
Copy link

Description

When deploying docker stacks to a docker swarm the http_proxy values in the config.json are not injected as environment variables into the containers created by the stack.

It appears that when the swarm creates containers as part of a stack it is either ignoring or cant access to the .docker/config.json file in the user folder.

There are only 2 users that exist on this machine and i have put a file in the directories of both

Steps to reproduce the issue:

  1. On a docker swarm create and populate a proxy in .docker/config.json
  2. Manually create a container from the cli and output the environment docker run alpine env
  3. see that the proxy values are present
  4. Create a stack file and deploy to the swarm
  5. identify and interrogate the container created for its env.
  6. See that the above proxy values are not present.

Describe the results you received:
No proxy environment variables are created inside containers created by swarm.

Describe the results you expected:
http_proxy environment variables should be populated inside each container created by the stack

Additional information you deem important (e.g. issue happens only occasionally):
I have followed the instructions in both these places
https://docs.docker.com/network/proxy/
https://docs.docker.com/config/daemon/systemd/#httphttps-proxy

I can see the proxy values in docker info on the host

Output of docker version:

# docker version
Client: Docker Engine - Community
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        48a66213fe
 Built:             Mon Jun 22 15:46:54 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:25:42 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker info:

# docker info
Client:
 Debug Mode: false

Server:
 Containers: 39
  Running: 25
  Paused: 0
  Stopped: 14
 Images: 199
 Server Version: 19.03.8
 Storage Driver: overlay2
  Backing Filesystem: <unknown>
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: fluentd
 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: p5oiyeez5000q18xdchlgtced
  Is Manager: true
  ClusterID: om7itovwg9m4e413mr5stiuk3
  Managers: 1
  Nodes: 1
  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: 130.145.254.90
  Manager Addresses:
   130.145.254.90:2377
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 3.10.0-1127.13.1.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 3.701GiB
 Name: cardiolab254blauw90.htc.ms.philips.com
 ID: SLWI:3ELX:HIYY:BISL:RBKR:OMJX:7IGC:7ATE:FSD4:I5WP:R47U:YBOK
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http://x.x.x.x:9480/
 HTTPS Proxy: http://x.x.x.x:9480/
 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

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

@thaJeztah thaJeztah added kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. area/stack version/19.03 labels Sep 17, 2023
@cnrshantanu
Copy link

Any update on this, is there a plan to support this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/stack kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. version/19.03
Projects
None yet
Development

No branches or pull requests

3 participants