-
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
--env-file
doesn't support inline comments
#4404
Comments
This is by design (but can be confusing, because compose also implemented an The compose The Changing that would be a breaking change, so not likely something we could do |
It isn't really clear from this that line comments are supported but not inline... So maybe the documentation can be updated? |
Can i work on This? @thaJeztah |
Is this issue still open or was it fixed in #4464 ? |
open bro |
I would like to work on it @thaJeztah |
Yes, looks like #4464 was closed before it was reviewed/merged. We should probably use similar wording as we do for describing how comments are handled in the Dockerfile syntax; https://docs.docker.com/engine/reference/builder/ /cc @dvdksn |
@desmond3th feel free to open a PR! |
Description
Currently
docker run --env-file someenvfile.env sometag
doesn't remove inline comments -- so if something likeSOMEVAR=somevalue # comment
is written,SOMEVAR
is set tosomevalue # comment
instead ofsomevalue
.Similar issue for Docker Compose was fixed about 1.5 years ago.
Reproduce
echo 'SOMEVAR=somevalue # comment' > test.env
docker run --env-file test.env bash bash -c 'echo $''SOMEVAR'
Expected behavior
somevalue
is expected butsomevalue # comment
is actual.docker version
Client: Docker Engine - Community Cloud integration: v1.0.35 Version: 24.0.2 API version: 1.43 Go version: go1.20.4 Git commit: cb74dfc Built: Thu May 25 21:52:17 2023 OS/Arch: linux/amd64 Context: default Server: Docker Desktop Engine: Version: 24.0.2-38-g8e70a1b23e API version: 1.43 (minimum version 1.12) Go version: go1.20.4 Git commit: 8e70a1b23e965d86ec8c2feb77605196ae124630 Built: Fri Jun 2 15:58:50 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.21 GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8 runc: Version: 1.1.7 GitCommit: v1.1.7-0-g860f061 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: