-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
builder: rephrase ENV section, remove examples for ENV key value without '=' #2741
Conversation
…out '=' The `ENV key value` form can be ambiguous, for example, the following defines a single env-variable (`ONE`) with value `"TWO= THREE=world"`: ENV ONE TWO= THREE=world While we cannot deprecate/remove that syntax (as it would break existing Dockerfiles), we should reduce exposure of the format in our examples. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Codecov Report
@@ Coverage Diff @@
## master #2741 +/- ##
=======================================
Coverage 57.15% 57.15%
=======================================
Files 297 297
Lines 18657 18657
=======================================
Hits 10663 10663
Misses 7132 7132
Partials 862 862 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with just one comment
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y ... | ||
``` | ||
|
||
Or using [`ARG`](#arg), which is not persisted in the final image: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should enforce that, I consider it more a trick than a real feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a build-time argument/option, so I think it's a valid use, not different from, e.g.
ARG VERSION=v1.0.0
RUN install foo-${VERSION}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me the ARG
semantic is to expose a customization point to the user, not to set an env var only during build step. So yes it works, but should we advertise it in the doc?
docs/reference/builder.md
Outdated
> ``` | ||
> | ||
> The alternative syntax is supported for backward compatibility, but discouraged | ||
> for the reasons outlined above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and may be removed in a future version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated; PTAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #2743 if we want to officially deprecate
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
098e3c2
to
0eb3cfd
Compare
relates to moby/buildkit#1692 (comment)
- What I did
The
ENV key value
form can be ambiguous, for example, the following definesa single env-variable (
ONE
) with value"TWO= THREE=world"
:ENV ONE TWO= THREE=world
While we cannot deprecate/remove that syntax (as it would break existing
Dockerfiles), we should reduce exposure of the format in our examples.
- A picture of a cute animal (not mandatory but encouraged)