Open umarcor opened 3 years ago
https://github.com/moby/buildkit/issues/2034#issuecomment-805445957 is the recommended method for achieving this.
--from
supports ARG
but only the ones in the global scope.
#2034 (comment) is the recommended method for achieving this.
That is a workaround for an unsupported feature, not a solution to the feature request; hence, the creation of this issue.
--from
supportsARG
but only the ones in the global scope.
Can you please provide an example? I tried four variants (lowercase and uppercase) but all of them are failing:
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to parse stage name "$REGISTRY/pkg/icestorm": invalid reference format: repository name must be lowercase
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to parse stage name "$registry/pkg/icestorm": invalid reference format
failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = failed to create LLB definition: failed to parse stage name "$REGISTRY/pkg:icestorm": invalid reference format: repository name must be lowercase
failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = failed to create LLB definition: failed to parse stage name "$registry/pkg:icestorm": invalid reference format
Can you please provide an example?
The example on the link is what I meant. You can't write the $ARG
directly in the flag because then the arg would be in local (stage) scope that isn't supported. Therefore you need to get it through an extra FROM
command that gives you access to the args in the global scope.
PSA: If anyone wants to take this on then please confirm the design here first as there are some tricky cases to consider.
You can't write the $ARG directly in the flag because then the arg would be in local (stage) scope that isn't supported.
I updated the title of issue to specify that the feature request is supporting the usage of local args, such as:
ARG REGISTRY='docker.io/hdlc'
FROM $REGISTRY/build:build AS build
ARG REGISTRY
COPY --from=$REGISTRY/pkg:icestorm /icestorm/usr/local/share/icebox /usr/local/share/icebox
It would be desirable to support copying content from an image using a variable/argument for specifying the image name. For instance:
or
Refs:
2034
1167
815 #2089.
from
is explicitly not supported by #2089: "from expansion is not supported".