deprecate Dockerfile legacy 'ENV name value' syntax#2743
deprecate Dockerfile legacy 'ENV name value' syntax#2743tiborvass merged 1 commit intodocker:masterfrom
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 syntax for `ENV` instructions that doesn't use an assignment operator is being phased out. docker/cli#2743 Legacy syntax: `ENV var value` Current syntax: `ENV var=value`
The syntax for `ENV` instructions that doesn't use an assignment operator is being phased out. docker/cli#2743 Legacy syntax: `ENV var value` Current syntax: `ENV var=value`
The syntax for `ENV` instructions that doesn't use an assignment operator is being phased out. docker/cli#2743 Legacy syntax: `ENV var value` Current syntax: `ENV var=value`
The syntax for `ENV` instructions that doesn't use an assignment operator is being phased out. docker/cli#2743 Legacy syntax: `ENV var value` Current syntax: `ENV var=value`
The syntax for `ENV` instructions that doesn't use an assignment operator is being phased out. docker/cli#2743 Legacy syntax: `ENV var value` Current syntax: `ENV var=value`
The endorsed format for specifying environment variables in Dockerfile is: ENV key="value" The old format is deprecated as of 2020 [1][2]. Fix our formatter to follow correct format. 1: docker/cli#2743 2: docker/cli#2741 Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
The Dockerfile
ENVinstruction allows values to be set using eitherENV name=valueor
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
ENVline in the Dockerfile.Use of the
ENV name valuesyntax is discouraged, and may be removed in a futurerelease. Users are encouraged to update their Dockerfiles to use the
ENV name=valuesyntax, for example:
- Description for the changelog
- deprecate Dockerfile legacy 'ENV name value' syntax- A picture of a cute animal (not mandatory but encouraged)