From 73dd6b93c22f1c732eeba792232e2f70ae09dac9 Mon Sep 17 00:00:00 2001 From: Travis Groth Date: Wed, 12 Jan 2022 12:51:47 -0500 Subject: [PATCH] deployment: fix distroless base arch (#2925) --- .github/Dockerfile-release | 4 +--- .github/goreleaser.yaml | 4 ++-- Dockerfile | 4 +--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/Dockerfile-release b/.github/Dockerfile-release index 62fcf72f9..7670fc5a1 100644 --- a/.github/Dockerfile-release +++ b/.github/Dockerfile-release @@ -1,5 +1,3 @@ -ARG ARCH - # build our own root trust store from current stable FROM debian:stable as casource RUN apt-get update && apt-get install -y ca-certificates @@ -10,7 +8,7 @@ RUN rm /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt && update-ca-certif FROM busybox:latest as build RUN touch /config.yaml -FROM gcr.io/distroless/base-debian10:latest-${ARCH} +FROM gcr.io/distroless/base-debian10:latest-${TARGETARCH:-amd64} ENV AUTOCERT_DIR /data/autocert WORKDIR /pomerium COPY pomerium* /bin/ diff --git a/.github/goreleaser.yaml b/.github/goreleaser.yaml index 0e6fc1eab..42eb47b3d 100644 --- a/.github/goreleaser.yaml +++ b/.github/goreleaser.yaml @@ -67,7 +67,7 @@ dockers: dockerfile: .github/Dockerfile-release build_flag_templates: - "--pull" - - "--build-arg=ARCH=amd64" + - "--platform=linux/amd64" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.name={{.ProjectName}}" - "--label=org.opencontainers.image.revision={{.FullCommit}}" @@ -95,7 +95,7 @@ dockers: dockerfile: .github/Dockerfile-release build_flag_templates: - "--pull" - - "--build-arg=ARCH=arm64" + - "--platform=linux/arm64" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.name={{.ProjectName}}" - "--label=org.opencontainers.image.revision={{.FullCommit}}" diff --git a/Dockerfile b/Dockerfile index 4ccf5449c..5cd0a6423 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,3 @@ -ARG ARCH=amd64 - FROM golang:latest as build WORKDIR /go/src/github.com/pomerium/pomerium @@ -22,7 +20,7 @@ RUN apt-get update && apt-get install -y ca-certificates # Remove expired root (https://github.com/pomerium/pomerium/issues/2653) RUN rm /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt && update-ca-certificates -FROM gcr.io/distroless/base:debug-${ARCH} +FROM gcr.io/distroless/base:debug-${TARGETARCH:-amd64} ENV AUTOCERT_DIR /data/autocert WORKDIR /pomerium COPY --from=build /go/src/github.com/pomerium/pomerium/bin/* /bin/