diff --git a/Dockerfile b/Dockerfile index ed8d0b5fe7..665a062f6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,11 @@ ARG DEFAULT_CONFTEST_VERSION=0.56.0 # Stage 1: build artifact and download deps -FROM golang:${GOLANG_TAG} AS builder +FROM --platform=$BUILDPLATFORM golang:${GOLANG_TAG} AS builder + +# These are automatically populated by Docker +ARG TARGETOS +ARG TARGETARCH ARG ATLANTIS_VERSION=dev ENV ATLANTIS_VERSION=${ATLANTIS_VERSION} @@ -42,7 +46,7 @@ RUN --mount=type=cache,target=/go/pkg/mod \ COPY . /app RUN --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ - CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X 'main.version=${ATLANTIS_VERSION}' -X 'main.commit=${ATLANTIS_COMMIT}' -X 'main.date=${ATLANTIS_DATE}'" -v -o atlantis . + CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -trimpath -ldflags "-s -w -X 'main.version=${ATLANTIS_VERSION}' -X 'main.commit=${ATLANTIS_COMMIT}' -X 'main.date=${ATLANTIS_DATE}'" -v -o atlantis . FROM debian:${DEBIAN_TAG} AS debian-base @@ -155,7 +159,7 @@ COPY --from=deps /usr/bin/git-lfs /usr/bin/git-lfs COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh # renovate: datasource=repology depName=alpine_3_21/ca-certificates versioning=loose -ENV CA_CERTIFICATES_VERSION="20241010" +ENV CA_CERTIFICATES_VERSION="20241121" # Install packages needed to run Atlantis. # We place this last as it will bust less docker layer caches when packages update