dockerfile: allow multiple values for ARG#1692
Conversation
|
So, if I recall correctly, we didn't do this, because Because of that, the following would be very confusing as they have completely different meanings: # declare three ARGs: ONE, TWO, and THREE
ARG ONE TWO THREE
# define one ENV (ONE) with value "TWO THREE"
ENV ONE TWO THREESo, the ARG ONE=hello
FROM busybox AS stage-foo
# declare three ARGs:
ARG ONE TWO= THREE=worldIn the example above;
Env vars did get some validation to try to prevent some accidental mistakes; ENV ONE=one TWO two THREE three
But will only produce an error if the first env-var uses an ENV ONE TWO= THREE=worldAnd produce a single env-var ( So not sure what to do with this. I realize My ideal would be to use the same syntax for |
thaJeztah
left a comment
There was a problem hiding this comment.
leaving a "request changes" review, as this may need some discussion (see my comment)
|
If you are annoyed about the ambiguity of |
Signed-off-by: Tonis Tiigi <[email protected]>
e188159 to
c810b8e
Compare
There was a problem hiding this comment.
After discussing above, and docker/cli#2741, docker/cli#2743 to reduce confusion, I think it's ok to support this
LGTM
|
We should probably update the legacy builder as well to support the format? |
|
I would argue that allowing The whole reason |
Why? The whole Dockerfile language is modeled after shell, and
Where I've seen it, it has always looked like a logical grouping of related values. That is also why having same for |
Podman and older versions of docker do not support multiple args on a single line. It was recently added to docker in this commit moby/buildkit#1692 and podman still dose not have support for it. Signed-off-by: zachaller <[email protected]>
Podman and older versions of docker do not support multiple args on a single line. It was recently added to docker in this commit moby/buildkit#1692 and podman still dose not have support for it. Signed-off-by: zachaller <[email protected]>
Podman and older versions of docker do not support multiple args on a single line. It was recently added to docker in this commit moby/buildkit#1692 and podman still dose not have support for it. Signed-off-by: zachaller <[email protected]> Signed-off-by: wojtekidd <[email protected]>
ENVaccepts multiple definitions with a single command, no reason whyARGshould behave any differently.Signed-off-by: Tonis Tiigi [email protected]