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

ENV depending on each other in a single layer #14914

Closed
caarlos0 opened this issue Jul 23, 2015 · 1 comment
Closed

ENV depending on each other in a single layer #14914

caarlos0 opened this issue Jul 23, 2015 · 1 comment

Comments

@caarlos0
Copy link
Contributor

If I set multiple variables in one layer, with one variable depending on the value of the other, it would not work.

Example Dockerfile:

FROM alpine
ENV VAR1="VALUE" \
  VAR2="VAL 1 = $VAR1"
ENTRYPOINT env | grep VAR

Running:

$ docker build -t vars .
# ...
$ docker run -t vars
VAR1=VAR 1 VALUE
VAR2=VAL 1 = 

Tested on Docker 1.6.2 and 1.7.1.


docker version:

Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64

docker info:

Containers: 34
Images: 398
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 466
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.19.0-21-generic
Operating System: Ubuntu 15.04
CPUs: 4
Total Memory: 7.704 GiB
Name: becker
ID: OBGW:LNVQ:XU5O:IXO3:G4RG:FIIN:TVGE:SZFL:L5IE:YFLQ:JILX:FAOQ
Username: caninjas
Registry: https://index.docker.io/v1/
WARNING: No swap limit support

uname -a

Linux becker 3.19.0-21-generic #21-Ubuntu SMP Sun Jun 14 18:31:11 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
@duglin
Copy link
Contributor

duglin commented Jul 23, 2015

at one point we almost let in a PR that could do that but then it was rejected because that's not a normal sh-ism. Would have been cool though :-) So, gonna close this as a dup - see: #10431 (comment)

ping @tianon if he has any extra comments

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

2 participants