I am trying to use docker-compose ARGs in multi-stage build context. My dockerfile looks like this:
ARG PHP_VERSION
FROM php:${PHP_VERSION}
ARG COMPOSER_VERSION
COPY --from=composer:${COMPOSER_VERSION} /usr/bin/composer /usr/bin/composer
The PHP_VERSION argument is working just fine. However, the COMPOSER_VERSION in the fourth line results in the following error:
ERROR: Service 'app' failed to build: invalid from flag value composer:${COMPOSER_VERSION}: invalid reference format.
Any help would be greatly appreciated.