-
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
deprecate Dockerfile legacy 'ENV name value' syntax #2743
deprecate Dockerfile legacy 'ENV name value' syntax #2743
Conversation
The Dockerfile `ENV` instruction allows values to be set using either `ENV name=value` or `ENV name value`. The latter (`ENV name value`) form can be ambiguous, for example, the following defines a single env-variable (`ONE`) with value `"TWO= THREE=world"`, but may have intended to be setting three env-vars: ENV ONE TWO= THREE=world This format also does not allow setting multiple environment-variables in a single `ENV` line in the Dockerfile. Use of the `ENV name value` syntax is discouraged, and may be removed in a future release. Users are encouraged to update their Dockerfiles to use the `ENV name=value` syntax, for example: ENV ONE="" TWO="" THREE="world" Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@tonistiigi @tiborvass ptal |
Codecov Report
@@ Coverage Diff @@
## master #2743 +/- ##
=======================================
Coverage 57.15% 57.15%
=======================================
Files 297 297
Lines 18657 18657
=======================================
Hits 10663 10663
Misses 7132 7132
Partials 862 862 |
What's the end goal of deprecating this (very widely used) syntax? Do we actually think we can remove support for it in the future without causing massive breakage? (Again, to what end?) Why not instead detect the ambiguous case and provide a warning? |
Some more details in moby/buildkit#1692 (comment) |
There is no timeline to remove it atm. and we'll not do it if it can cause a big breakage. This is phase 1 where we need to send a clear message that this syntax should not be used anymore. |
I'd recommend not removing the without- |
Reiterating for the record that I think deprecating this syntax is a mistake. 😞 Coming from the context of moby/buildkit#4759, I would re-iterate "Why not instead detect the ambiguous case and provide a warning?" Helping people find |
Now I'm seeing a lot of useless Can we please remove that linter warning? (or at least disable it by default somehow so users can opt into it instead?) |
The Dockerfile
ENV
instruction allows values to be set using eitherENV name=value
or
ENV name value
. The latter (ENV name value
) form can be ambiguous, for example,the following defines a single env-variable (
ONE
) with value"TWO= THREE=world"
,but may have intended to be setting three env-vars:
This format also does not allow setting multiple environment-variables in a single
ENV
line in the Dockerfile.Use of the
ENV name value
syntax is discouraged, and may be removed in a futurerelease. Users are encouraged to update their Dockerfiles to use the
ENV name=value
syntax, for example:
- Description for the changelog
- deprecate Dockerfile legacy 'ENV name value' syntax
- A picture of a cute animal (not mandatory but encouraged)