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 stack deploy does not read env_file #42252

Open
moonflash opened this issue Apr 5, 2021 · 0 comments
Open

docker stack deploy does not read env_file #42252

moonflash opened this issue Apr 5, 2021 · 0 comments

Comments

@moonflash
Copy link

Description

Up until recently docker stack deploy was reading env_file values without any issues.
Few days ago i started having issues

Deploying stack to the swarm I use to do with
DOCKER_HOST=ssh://address docker stack deploy -c docker-compose.yml service_name env_file=/pat/to/production.env

Steps to reproduce the issue:

  1. docker-compose.yml has
environment:
  API_URL: ${API_URL}
  1. DOCKER_HOST=ssh://address docker stack deploy -c docker-compose.yml service_name env_file=/pat/to/production.env

Describe the results you received:
even though I got this as a stdout:

Deployment environment:
SMS_SERVICE_SECRET=**********
SMS_SERVICE_URL=https://*****.execute-api.eu-west-1.amazonaws.com/prod
API_URL=https://myurl.com
FRONTEND_APP_URL=https://frontend.com

I got this error:

The SMS_SERVICE_SECRET variable is not set. Defaulting to a blank string.
The SMS_SERVICE_URL variable is not set. Defaulting to a blank string.
The API_URL variable is not set. Defaulting to a blank string.
The FRONTEND_APP_URL variable is not set. Defaulting to a blank string.

Describe the results you expected:
if API_URL=https://api.url is passed properly , docker-compose.yml should read ${API_URL}

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:
Locally on my MACOS:

Client: Docker Engine - Community
 Cloud integration: 1.0.9
 Version:           20.10.5
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        55c4c88
 Built:             Tue Mar  2 20:13:00 2021
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.5
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       363e9a8
  Built:            Tue Mar  2 20:15:47 2021
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

on the remote server:

Client:
 Version:           19.03.6-ce
 API version:       1.40
 Go version:        go1.13.4
 Git commit:        369ce74
 Built:             Fri May 29 04:01:26 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.6-ce
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.4
  Git commit:       369ce74
  Built:            Fri May 29 04:01:57 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.3.2
  GitCommit:        ff48f57fc83a8c44cf4ad5d672424a98ba37ded6
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Output of docker info:

Client:
 Debug Mode: false

Server:
 Containers: 10
  Running: 5
  Paused: 0
  Stopped: 5
 Images: 33
 Server Version: 19.03.6-ce
 Storage Driver: overlay2
  Backing Filesystem: xfs
  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: active
  NodeID: 7buusrqh2s0li50sm6qq730q3
  Is Manager: true
  ClusterID: 1ycj2j0vuieo4ovmshxfs50i7
  Managers: 5
  Nodes: 5
  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: 172.31.23.143
  Manager Addresses:
   172.31.18.20:2377
   172.31.23.143:2377
   172.31.24.171:2377
   172.31.29.122:2377
   172.31.39.121:2377
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ff48f57fc83a8c44cf4ad5d672424a98ba37ded6
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.14.198-152.320.amzn2.x86_64
 Operating System: Amazon Linux 2
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.851GiB
 Name: demo
 ID: MDN4:I5TD:XAAT:3MWJ:LP2B:72WU:GPZ7:I3JH:YP2E:6AXG:ABZN:6CNH
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: myorbltd
 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.):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant