diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index f36ef0f..8bd9c23 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -53,6 +53,7 @@ jobs: - name: Build and Push Image env: KO_DEFAULTBASEIMAGE: gcr.io/distroless/static-debian12:nonroot + KO_DEFAULTPLATFORMS: linux/amd64,linux/arm64 run: | push_host="$(git remote get-url origin | sed -E 's#^[a-z]+://([^/]+)/.*#\1#')" export KO_DOCKER_REPO="${push_host}/${GITHUB_REPOSITORY}" diff --git a/Dockerfile b/Dockerfile index dc9b781..51abd32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,15 @@ FROM golang:1.26 AS build WORKDIR /src +ARG TARGETOS=linux +ARG TARGETARCH + COPY go.mod go.sum ./ RUN go mod download COPY . . -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags='-s -w' -o /out/alma-assignments-reporter . +RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -trimpath -ldflags='-s -w' -o /out/alma-assignments-reporter . FROM scratch