From 35e538934c0173bd8b22a855cd9ce19bbd3dfa0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bojan=20=C4=8Cekrli=C4=87?= Date: Thu, 30 Jan 2025 20:30:57 +0100 Subject: [PATCH] Fix: Remove build for ARMv5, as Go does not support ARMv5 images anymore. --- .github/actions/build-postfix-exporter/action.yaml | 2 +- postfix-exporter-01.patch | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-postfix-exporter/action.yaml b/.github/actions/build-postfix-exporter/action.yaml index 80513c7..f5a8b50 100644 --- a/.github/actions/build-postfix-exporter/action.yaml +++ b/.github/actions/build-postfix-exporter/action.yaml @@ -68,7 +68,7 @@ runs: push: true tags: '${{ inputs.tags }}' labels: ${{ steps.meta.outputs.labels }} - platforms: "linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x" + platforms: "linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x" # linux/386,linux/arm/v6,linux/arm64,linux/riscv64" cache-from: type=local,src=/tmp/.buildx-cache/postfix-exporter,mode=max,compression=estargz cache-to: type=local,dest=/tmp/.buildx-cache-new/postfix-exporter diff --git a/postfix-exporter-01.patch b/postfix-exporter-01.patch index f8da945..fec06e0 100644 --- a/postfix-exporter-01.patch +++ b/postfix-exporter-01.patch @@ -5,7 +5,7 @@ index 75a22d8..81145c9 100644 @@ -1,8 +1,41 @@ -FROM scratch +# syntax=docker/dockerfile:1.2 -+FROM --platform=$BUILDPLATFORM golang:1.23 AS builder ++FROM golang:1.23 AS builder LABEL org.opencontainers.image.source="https://github.com/hsn723/postfix_exporter" \ org.opencontainers.image.authors="Hsn723" \ org.opencontainers.image.title="postfix_exporter" @@ -38,7 +38,6 @@ index 75a22d8..81145c9 100644 +# Since we are checking out a specific SHA hash and we know this tests have worked previously, we are quite certain that the code will work. +# Hence disabling the test here. +# RUN go test -+RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM $TARGETOS/$TARGETARCH/$TARGETVARIANT" +RUN env GOOS="${TARGETOS}" GOARCH="${TARGETARCH}" GOARM="$( echo "$TARGETVARIANT" | grep -E -o "\\d+$")" go build -ldflags '-extldflags "-static"' -o /bin/postfix_exporter + +FROM scratch