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:
parent
2d472779b0
commit
ab37c5403a
3 changed files with 6 additions and 9 deletions
|
|
@ -31,11 +31,10 @@ FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
|
|||
|
||||
WORKDIR /app
|
||||
|
||||
# 1. Copier l'artefact publié depuis l'image de build. On ne référence
|
||||
# pas pazof/yavsc-build-env:latest directement — le contexte de
|
||||
# build (compose ou CI) contrôle quelle image source est utilisée.
|
||||
ARG BUILD_ENV_IMAGE=pazof/yavsc-build-env:debian12-dotnet10-android36-v1
|
||||
COPY --from=${BUILD_ENV_IMAGE} /app/publish/Yavsc.Org/ ./
|
||||
# 1. Copier l'artefact publié depuis l'image de build. On référence
|
||||
# l'image de build par son tag pinné : changer le tag veut dire
|
||||
# modifier les trois Dockerfile.runtime* en même temps.
|
||||
COPY --from=pazof/yavsc-build-env:debian12-dotnet10-android36-v1 /app/publish/Yavsc.Org/ ./
|
||||
|
||||
# 2. appsettings-org.json : injecté via BuildKit secret mount.
|
||||
# Le /run/secrets/... est un tmpfs éphémère, on copie dans /app puis
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -16,8 +16,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.Blogs/ ./
|
||||
COPY --from=pazof/yavsc-build-env:debian12-dotnet10-android36-v1 /app/publish/Yavsc.Blogs/ ./
|
||||
|
||||
RUN --mount=type=secret,id=yavsc_appsettings,dst=/run/secrets/yavsc_appsettings \
|
||||
cp /run/secrets/yavsc_appsettings /app/appsettings-org.json \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue