docker: hardcode BUILD_ENV_IMAGE tag in COPY --from=

'COPY --from=${BUILD_ENV_IMAGE}' is rejected by BuildKit:
  failed to solve: failed to parse stage name "${BUILD_ENV_IMAGE}":
    invalid reference format: repository name
    (library/${BUILD_ENV_IMAGE}) must be lowercase

A COPY --from= can only reference either a local stage of the
same Dockerfile, or a static image reference. ARG interpolation
in the stage name is not supported.

Replace the ARG + interpolation with the pinned tag in all
three Dockerfile.runtime* files. Bumping the build-env image
now means updating Dockerfile, Dockerfile.backend, and the three
Dockerfile.runtime* in lockstep.
This commit is contained in:
Paul Schneider 2026-06-27 16:26:39 +01:00
commit ab37c5403a
3 changed files with 6 additions and 9 deletions

View file

@ -15,8 +15,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app
ARG BUILD_ENV_IMAGE=pazof/yavsc-build-env:debian12-dotnet10-android36-v1
COPY --from=${BUILD_ENV_IMAGE} /app/publish/Yavsc.Api/ ./
COPY --from=pazof/yavsc-build-env:debian12-dotnet10-android36-v1 /app/publish/Yavsc.Api/ ./
RUN --mount=type=secret,id=yavsc_appsettings,dst=/run/secrets/yavsc_appsettings \
cp /run/secrets/yavsc_appsettings /app/appsettings-org.json \