Skip to content

Commit

Permalink
Fix: Remove build for ARMv5, as Go does not support ARMv5 images anym…
Browse files Browse the repository at this point in the history
…ore.
  • Loading branch information
bokysan committed Jan 30, 2025
1 parent 29f5eb7 commit 35e5389
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-postfix-exporter/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions postfix-exporter-01.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 35e5389

Please sign in to comment.