Skip to content

Commit 6b6d67e

Browse files
committed
Fix: Rollback to kumina/postfix_exporter
1 parent 3fc9616 commit 6b6d67e

File tree

3 files changed

+22
-37
lines changed

3 files changed

+22
-37
lines changed

.github/actions/build-postfix-exporter/action.yaml

+3-7
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ runs:
1919
- name: Checkout
2020
uses: actions/checkout@v4
2121
with:
22-
repository: Hsn723/postfix_exporter # Hsn723 repo is actually being updated
22+
repository: kumina/postfix_exporter
2323
path: 'postfix_exporter'
24-
ref: 'v0.7.0' # Latest commit we know that works
24+
ref: 'a6f58e9b2b2b4decc7e65c5a34b4fd53cd6665f1' # Latest commit we know that works
2525

2626
- name: Apply patches
2727
shell: bash
@@ -68,11 +68,7 @@ runs:
6868
push: true
6969
tags: '${{ inputs.tags }}'
7070
labels: ${{ steps.meta.outputs.labels }}
71-
# linux/arm/v5 and linux/arm/v6 are not supported anymore by upstream Go docker images.
72-
# Technically, we could build them but we would need to bootstrap the whole Go compiler.
73-
# However, I'm not sure if it's worth it.
74-
platforms: "linux/amd64,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x"
75-
# linux/386,linux/arm/v6,linux/arm64,linux/riscv64"
71+
platforms: "linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x"
7672
cache-from: type=local,src=/tmp/.buildx-cache/postfix-exporter,mode=max,compression=estargz
7773
cache-to: type=local,dest=/tmp/.buildx-cache-new/postfix-exporter
7874

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Several potentially "surprising" changes went into this issue and hence warrant
131131
- **[`master`](https://github.com/bokysan/docker-postfix/tree/master/) branch now builds images called [`edge`](https://hub.docker.com/r/boky/postfix/tags?page=1&name=edge)**.
132132
`latest` images are built from the last tag. We've had several issues with people using the `latest` tag
133133
and reporting problems. You can now rely on `latest` being the latest stable release.
134-
- Image now builds its own version of [postfix-exporter](https://github.com/hsn723/postfix_exporter) and relies on this
134+
- Image now builds its own version of [postfix-exporter](https://github.com/kumina/postfix_exporter) and relies on this
135135
third-party project. Checkout is from master branch, based
136136
on specific SHA commit id. The same hash is used for master and tags.
137137
- **Architecture galore!** With the addition of debian images, we now support support more architectures than ever. The list includes:

postfix-exporter-01.patch

+18-29
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
11
diff --git a/Dockerfile b/Dockerfile
2-
index 75a22d8..81145c9 100644
2+
index a3327d8..1cdfa84 100644
33
--- a/Dockerfile
44
+++ b/Dockerfile
5-
@@ -1,8 +1,41 @@
6-
-FROM scratch
5+
@@ -1,4 +1,10 @@
6+
-FROM golang:1.16 AS builder
77
+# syntax=docker/dockerfile:1.2
8-
+FROM golang:1.23 AS builder
9-
LABEL org.opencontainers.image.source="https://github.com/hsn723/postfix_exporter" \
10-
org.opencontainers.image.authors="Hsn723" \
11-
org.opencontainers.image.title="postfix_exporter"
8+
+FROM golang:1.21.3-bookworm AS builder
129
+ARG TARGETPLATFORM
1310
+ARG TARGETOS
1411
+ARG TARGETARCH
1512
+ARG TARGETVARIANT
1613
+
17-
+WORKDIR /src
18-
+
19-
+# avoid downloading the dependencies on successive builds
20-
+RUN apt-get update -qq && apt-get install -qqy \
21-
+ build-essential \
22-
+ libsystemd-dev
23-
+
24-
+COPY go.mod go.sum ./
25-
+RUN go mod download
26-
+RUN go mod verify
27-
+
28-
+COPY . .
29-
+
30-
+# Force the go compiler to use modules
31-
+ENV GO111MODULE=on
14+
WORKDIR /src
15+
16+
# avoid downloading the dependencies on succesive builds
17+
@@ -14,10 +20,18 @@ COPY . .
18+
19+
# Force the go compiler to use modules
20+
ENV GO111MODULE=on
21+
-RUN go test
22+
-RUN go build -o /bin/postfix_exporter
3223
+# go test fails (sometimes) because it relies on an external dependency:
3324
+#
3425
+# warning: SASL authentication failure: cannot connect to saslauthd server: Permission denied
@@ -39,12 +30,10 @@ index 75a22d8..81145c9 100644
3930
+# Hence disabling the test here.
4031
+# RUN go test
4132
+RUN env GOOS="${TARGETOS}" GOARCH="${TARGETARCH}" GOARM="$( echo "$TARGETVARIANT" | grep -E -o "\\d+$")" go build -ldflags '-extldflags "-static"' -o /bin/postfix_exporter
42-
+
33+
34+
-FROM debian:latest
4335
+FROM scratch
4436
EXPOSE 9154
45-
-COPY postfix_exporter /
46-
-COPY LICENSE /
47-
-ENTRYPOINT ["/postfix_exporter"]
48-
+WORKDIR /
49-
+COPY --from=builder /bin/postfix_exporter /bin/
50-
+ENTRYPOINT ["/bin/postfix_exporter"]
37+
WORKDIR /
38+
COPY --from=builder /bin/postfix_exporter /bin/
39+

0 commit comments

Comments
 (0)