From 1ecc554b01ac24022d90f91774648985dfeb09e4 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 20 Aug 2022 21:29:40 +0200 Subject: [PATCH] Dockerfile: de-duplicate args When extending a stage, the new stage is considered a breakpoint, so FROM foo AS one ARG something FROM one AS two # ARG is present here as well Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 11f889c2..0e7a3347 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,9 @@ RUN --mount=target=. \ FROM gobase AS base ARG TARGETPLATFORM +ARG TARGETOS +ARG TARGETARCH +ARG TARGETVARIANT RUN xx-apk add musl-dev gcc libsecret-dev pass FROM base AS test @@ -43,9 +46,6 @@ FROM scratch AS test-coverage COPY --from=test /tmp/coverage.txt /coverage.txt FROM base AS build-linux -ARG TARGETOS -ARG TARGETARCH -ARG TARGETVARIANT RUN --mount=type=bind,target=. \ --mount=type=cache,target=/root/.cache \ --mount=type=cache,target=/go/pkg/mod \ @@ -59,8 +59,6 @@ RUN --mount=type=bind,target=. \ EOT FROM base AS build-darwin -ARG TARGETARCH -ARG TARGETVARIANT RUN --mount=type=bind,target=. \ --mount=type=cache,target=/root/.cache \ --mount=type=cache,target=/go/pkg/mod \ @@ -74,8 +72,6 @@ RUN --mount=type=bind,target=. \ EOT FROM base AS build-windows -ARG TARGETARCH -ARG TARGETVARIANT RUN --mount=type=bind,target=. \ --mount=type=cache,target=/root/.cache \ --mount=type=cache,target=/go/pkg/mod \