-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Parameter expansion when using docker run --env-file ....
#4347
Comments
Hm, ISTR this was by design, and If compose is expanding environment variables for these, that looks like a bug (or at least incompatible behavior) |
Oh! I guess compose's edit: Hm.. but |
Came accross something related. Seems like the parameter expansion capabilities of compose were extended relatively recently.
Did install the different compose versions via
and
,respectively. With Looks like the default value handling for parameter expansion was added with this PR which ended up in v2.7.0 So |
I think I just duplicated these issue here So I'm begging you to put here as much attension as you can, because it confuses very much and I think these feature can be extremely relevant and useful! |
Hey @thaJeztah, What do you think, is there a possibility to implement such functionallity? |
Description
Hi,
when running
docker run --env-file env.list --rm ubuntu
, parameter expansion is not applied to elements inenv.list
. The entryVAR=$USER
is not expanded thus the env VAR will be assigned the literal string "$USER" in the container. This is inconsistant with the behavior of environment files when used with docker compose.I hope this the correct repo and label. Sorry for any inconvenience.
Reproduce
echo VAR=\$USER > env.list
docker run --env-file env.list --rm -it ubuntu env | grep VAR
VAR=$USER
Expected behavior
The expected outcome should be the expanded value. In my case
VAR=marvin
. This would be in line with the behavior of docker compose.docker compose -f docker-compose.yml up
results inVAR=marvin
docker version
docker info
Client: Version: 24.0.2 Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: v0.10.5 Path: /usr/libexec/docker/cli-plugins/docker-buildx compose: Docker Compose (Docker Inc.) Version: v2.18.1 Path: /usr/libexec/docker/cli-plugins/docker-compose
Additional Info
No response
The text was updated successfully, but these errors were encountered: