build: variables (arg, env)#19386
Conversation
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
383e5e4 to
60eb76e
Compare
There was a problem hiding this comment.
Oh! Wanted to reply on slack but didn't get to that. I wonder if we could come up with a slightly modified example where the "breakpoint" stages are consecutive in the Dockerfile, i.e. (trying to give it my best ASCII-art here);
FROM alpine:${VERSION} AS stage-1
ARG HELLO=hello
RUN echo $HELLO
..................................
# stage-1-a is a continuation of stage-1, and therefore inherits build-args
# that are defined in it. This stage can be used as a "break-point" within
# the stage-1 stage.
FROM stage-1 AS stage-1-a
ARG WORLD=world
RUN echo $HELLO $WORLD
..................................
# similarly, stage-1-b is a continuation of stage-1-a, and can act as
# another break-point in stage-1 for debugging purposes.
FROM stage-1-a AS stage-1-b
RUN echo $HELLO $WORLDIn the above, we could put all of the stage-1-xxx in a single "box", but with a dotted separator between them perhaps.
60eb76e to
43db713
Compare
|
any blocking issues with this one @thaJeztah or @crazy-max. The illustration could maybe be prettier but I think it gets the message across. |
|
|
||
| ### BUILDKIT_HOST | ||
|
|
||
| _Introduced in [Buildx v0.9.0](../release-notes.md#090)_ |
There was a problem hiding this comment.
Comment: I've started using a note to do the same thing with Compose.
> Available in ....etc
Perhaps we should agree on a format going forward for the sake of consistency? Which is better?
There was a problem hiding this comment.
yes we definitely should standardize this. I think we should probably have a shortcode for it like k8s does with feature_state. That would also let us have more control over rendering, and better structure the parameters (possibly even let us specify and test for old versions to be cleaned up after a while). Maybe for a follow-up?
There was a problem hiding this comment.
"+1" on having this kind of information in a more structured form.
I recall we discussed this at some point, and know we have the "API version" annotations for some options, e.g.;
For those we (used to? still have?) a configurable "threshold", which allows use to conditionally render those badges. That way, we can keep the metadata (added in version X), but can decide whether it's still relevant to highlight/show (e.g., highlighting a feature that was added 6 or 7 years ago is no longer very informative).
If we have specific criteria, we could also use that information to automatically render "new" / "what's new" badges, such as what's being added in #19444 (add a "new" badge because it was added for Docker Desktop 4.28, but once we are a couple of version(s) along, we can hide that).
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
791d0b4 to
b5032e1
Compare
Proposed changes
Adds a new manuals page about build variables (arg, env) highlighting their differences and use.
https://deploy-preview-19386--docsdocker.netlify.app/build/building/variables/
Related issues (optional)
@netlify /build/building/variables/