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

[Regression] Environment variables are ignored during stack deployment #1391

Closed
anokun7 opened this issue Sep 25, 2018 · 0 comments · Fixed by #1392
Closed

[Regression] Environment variables are ignored during stack deployment #1391

anokun7 opened this issue Sep 25, 2018 · 0 comments · Fixed by #1392

Comments

@anokun7
Copy link

anokun7 commented Sep 25, 2018

Description
Environment variables used inside a docker-compose.yml are not getting evaluated. Environment variables allows for dynamic properties to be added to docker-compose.yml files to use them in different environments for example.

Steps to reproduce the issue:

  1. Example compose file
ᐅ cat test.yml -p
version: "3.3"

services:
  app:
    image: anoop/counter-demo:${version:-latest}
  1. Run docker stack deploy using an environment variable
ᐅ version=onbuild docker stack deploy -c test.yml c1
Creating network c1_default
Creating service c1_app
  1. Check the image used.
ᐅ docker stack ps c1
ID                  NAME                IMAGE                       NODE                DESIRED STATE       CURRENT STATE           ERROR               PORTS
yj1d99b0z2ty        c1_app.1            anoop/counter-demo:latest   ip-10-1-1-122.ec2   Running             Running 6 seconds ago
  1. The image is anoop/counter-demo:latest

Describe the results you received:
The image is anoop/counter-demo:latest

Describe the results you expected:
The image should have been anoop/counter-demo:onbuild as that was the value of the env variable used at the time the stack was deployed

Additional information you deem important (e.g. issue happens only occasionally):
Seems to happen only on the latest docker client. I am using 18.09.0-ce-beta1.
The same issue does not occur on 17.06.2-ee-16

Output of docker version:

Client: Docker Engine - Community
 Version:           18.09.0-ce-beta1
 API version:       1.30 (downgraded from 1.39)
 Go version:        go1.10.4
 Git commit:        78a6bdb
 Built:             Thu Sep  6 22:41:53 2018
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Enterprise Edition (EE) 2.0
 Engine:
  Version:          17.06.2-ee-16
  API version:      1.30 (minimum version 1.12)
  Go version:       go1.8.7
  Git commit:       9ef4f0a
  Built:            Thu Jul 26 16:42:19 2018
  OS/Arch:          linux/amd64
  Experimental:     false
 Universal Control Plane:
  Version:          3.0.5
  ApiVersion:       1.30
  Arch:             amd64
  BuildTime:        Thu Aug 30 17:47:03 UTC 2018
  GitCommit:        f588f8a
  GoVersion:        go1.9.4
  MinApiVersion:    1.20
  Os:               linux
 Kubernetes:
  Version:          1.8+
  buildDate:        2018-04-26T16:51:21Z
  compiler:         gc
  gitCommit:        8d637aedf46b9c21dde723e29c645b9f27106fa5
  gitTreeState:     clean
  gitVersion:       v1.8.11-docker-8d637ae
  goVersion:        go1.8.3
  major:            1
  minor:            8+
  platform:         linux/amd64
 Calico:
  Version:          v3.0.8
  cni:              v2.0.6
  kube-controllers: v2.0.5
  node:             v3.0.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants