Fix: Try to fix building of postfix-exporter

This commit is contained in:
Bojan Čekrlić 2025-01-30 20:18:42 +01:00
parent 1bdf77822f
commit 085746ea4d
5 changed files with 38 additions and 6 deletions

View file

@ -9,6 +9,10 @@ inputs:
description: 'Docker image tags' description: 'Docker image tags'
required: true required: true
env:
DOCKERHUB_REPO: boky/postfix-exporter
#GHCR_REPO: ghcr.io/bokysan/postfix-exporter
runs: runs:
using: "composite" using: "composite"
steps: steps:
@ -33,6 +37,22 @@ runs:
with: with:
DOCKER_ACCESS_TOKEN: '${{ inputs.DOCKER_ACCESS_TOKEN }}' DOCKER_ACCESS_TOKEN: '${{ inputs.DOCKER_ACCESS_TOKEN }}'
# GitHub container registry login
#- name: Login to GHCR
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKERHUB_REPO }}
# ${{ env.GHCR_REPO }}
- name: Cache Docker layers - name: Cache Docker layers
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
@ -42,11 +62,12 @@ runs:
${{ runner.os }}-postfix-exporter- ${{ runner.os }}-postfix-exporter-
- name: Build and push - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v6
with: with:
context: postfix_exporter context: postfix_exporter
push: true push: true
tags: '${{ inputs.tags }}' 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/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x"
# linux/386,linux/arm/v6,linux/arm64,linux/riscv64" # linux/386,linux/arm/v6,linux/arm64,linux/riscv64"
cache-from: type=local,src=/tmp/.buildx-cache/postfix-exporter,mode=max,compression=estargz cache-from: type=local,src=/tmp/.buildx-cache/postfix-exporter,mode=max,compression=estargz

View file

@ -9,7 +9,7 @@ runs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@master uses: docker/setup-buildx-action@v3
with: with:
install: true install: true

View file

@ -51,8 +51,6 @@ jobs:
tags: | tags: |
boky/postfix-exporter:latest boky/postfix-exporter:latest
boky/postfix-exporter:edge boky/postfix-exporter:edge
# boky/postfix-exporter:${{ env.RELEASE_VERSION }}
# boky/postfix-exporter:${{ env.RELEASE_VERSION_NO_v }}
Build_Alpine: Build_Alpine:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -131,7 +131,7 @@ Several potentially "surprising" changes went into this issue and hence warrant
- **[`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)**. - **[`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)**.
`latest` images are built from the last tag. We've had several issues with people using the `latest` tag `latest` images are built from the last tag. We've had several issues with people using the `latest` tag
and reporting problems. You can now rely on `latest` being the latest stable release. and reporting problems. You can now rely on `latest` being the latest stable release.
- Image now builds its own version of [postfix-exporter](https://github.com/kumina/postfix_exporter) and relies on this - Image now builds its own version of [postfix-exporter](https://github.com/hsn723/postfix_exporter) and relies on this
third-party project. Checkout is from master branch, based third-party project. Checkout is from master branch, based
on specific SHA commit id. The same hash is used for master and tags. on specific SHA commit id. The same hash is used for master and tags.
- **Architecture galore!** With the addition of debian images, we now support support more architectures than ever. The list includes: - **Architecture galore!** With the addition of debian images, we now support support more architectures than ever. The list includes:

View file

@ -5,7 +5,20 @@ if [ -f /tmp/container_is_terminating ]; then
fi fi
check_postfix() { check_postfix() {
printf "EHLO healthcheck\nquit\n" | \ local proxy_protocol="$(postconf postscreen_upstream_proxy_protocol | cut -f2- -d= | tr -d '[:blank:]')"
check_string="EHLO healthcheck\nquit\n"
if [ -n "$proxy_protocol" ]; then
check_string="PROXY TCP4 127.0.0.1 127.0.0.1 587 587\n${check_string}"
# ^--- proxied internet protocol and family
# ^--- source address
# ^--- destination address
# ^--- source port
# ^--- destination port
fi
printf "${check_string}" | \
{ while read l ; do sleep 1; echo $l; done } | \ { while read l ; do sleep 1; echo $l; done } | \
nc -w 2 127.0.0.1 587 | \ nc -w 2 127.0.0.1 587 | \
grep -qE "^220.*ESMTP Postfix" grep -qE "^220.*ESMTP Postfix"