-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARG in COPY causes invalid reference format #3356
Comments
Variable expansion in command For your use-case, I'd recommend creating an "alias" stage, in which you use the build-arg to specify the version. For example; # syntax=docker/dockerfile:1
ARG COMPOSER_VERSION=1.10.23
FROM composer:$COMPOSER_VERSION AS composer_binary
FROM php:8.0-fpm-alpine
COPY --from=composer_binary /usr/bin/composer /usr/local/bin/composer |
Let me close this ticket, as this looks to be working as expected, but feel free to continue the conversation |
Note that variable expansion in --from and FROM was working oddly, see: docker/cli#3356 (comment) for context.
Description
When using a build argument to refer to a image tag to copy files from, Docker returns with the error
image:$IMAGE_VERSION: invalid reference format
orimage:${IMAGE_VERSION}: invalid reference format
Steps to reproduce the issue:
Describe the results you received:
Docker fails the build step with
image:$IMAGE_VERSION: invalid reference format
orimage:${IMAGE_VERSION}: invalid reference format
Describe the results you expected:
for Docker to complete the build step and continue to the next
Additional information you deem important (e.g. issue happens only occasionally):
Dockerfile up to the error
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: