Skip to content

Commit

Permalink
Fix: Try to fix building of postfix-exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
bokysan committed Jan 30, 2025
1 parent 1bdf778 commit 085746e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 6 deletions.
23 changes: 22 additions & 1 deletion .github/actions/build-postfix-exporter/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: 'Docker image tags'
required: true

env:
DOCKERHUB_REPO: boky/postfix-exporter
#GHCR_REPO: ghcr.io/bokysan/postfix-exporter

runs:
using: "composite"
steps:
Expand All @@ -33,6 +37,22 @@ runs:
with:
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
uses: actions/cache@v4
with:
Expand All @@ -42,11 +62,12 @@ runs:
${{ runner.os }}-postfix-exporter-
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: postfix_exporter
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"
# linux/386,linux/arm/v6,linux/arm64,linux/riscv64"
cache-from: type=local,src=/tmp/.buildx-cache/postfix-exporter,mode=max,compression=estargz
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/buildx-setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:

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

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ jobs:
tags: |
boky/postfix-exporter:latest
boky/postfix-exporter:edge
# boky/postfix-exporter:${{ env.RELEASE_VERSION }}
# boky/postfix-exporter:${{ env.RELEASE_VERSION_NO_v }}
Build_Alpine:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)**.
`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.
- 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
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:
Expand Down
15 changes: 14 additions & 1 deletion scripts/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@ if [ -f /tmp/container_is_terminating ]; then
fi

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 } | \
nc -w 2 127.0.0.1 587 | \
grep -qE "^220.*ESMTP Postfix"
Expand Down

0 comments on commit 085746e

Please sign in to comment.