mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-11-17 22:58:46 +08:00
Upd: Add Debian building to the pipeline
This commit is contained in:
parent
b45c4ac11a
commit
2d21a4f908
8 changed files with 114 additions and 7 deletions
|
|
@ -47,7 +47,7 @@ runs:
|
|||
context: postfix_exporter
|
||||
push: true
|
||||
tags: '${{ inputs.tags }}'
|
||||
platforms: "linux/arm/v6,linux/arm/v7,linux/amd64,linux/arm64,linux/ppc64le,linux/s390x"
|
||||
platforms: "linux/386,linux/arm/v5,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/arm64,linux/mips64le,linux/ppc64le,linux/s390x,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
|
||||
|
||||
|
|
|
|||
45
.github/workflows/master.yml
vendored
45
.github/workflows/master.yml
vendored
|
|
@ -150,3 +150,48 @@ jobs:
|
|||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
|
||||
Build_Debian:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- Unit_Tests
|
||||
- Integration_Tests
|
||||
- Helm_chart_Tests
|
||||
steps:
|
||||
# Checkout
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Buildkit setup
|
||||
- uses: ./.github/actions/buildx-setup
|
||||
|
||||
# Docker hub login
|
||||
- uses: ./.github/actions/docker-hub-login
|
||||
with:
|
||||
DOCKER_ACCESS_TOKEN: '${{ secrets.DOCKER_ACCESS_TOKEN }}'
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
#key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
|
||||
key: ${{ runner.os }}-debian-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-debian-
|
||||
|
||||
- name: Build and push Debian
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: boky/postfix:edge-debian
|
||||
platforms: "linux/386,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/arm64,linux/mips64le,linux/ppc64le,linux/s390x"
|
||||
cache-from: type=local,src=/tmp/.buildx-cache/debian,mode=max,compression=estargz
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new/debian
|
||||
build-args: |
|
||||
BASE_IMAGE=debian:bookworm
|
||||
|
||||
- name: Move cache
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
|
||||
|
|
|
|||
51
.github/workflows/tags.yml
vendored
51
.github/workflows/tags.yml
vendored
|
|
@ -163,6 +163,57 @@ jobs:
|
|||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
|
||||
Build_Debian:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- Unit_Tests
|
||||
- Integration_Tests
|
||||
- Helm_chart_Tests
|
||||
steps:
|
||||
# Checkout
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# Buildkit setup
|
||||
- uses: ./.github/actions/buildx-setup
|
||||
|
||||
# Docker hub login
|
||||
- uses: ./.github/actions/docker-hub-login
|
||||
with:
|
||||
DOCKER_ACCESS_TOKEN: '${{ secrets.DOCKER_ACCESS_TOKEN }}'
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
#key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
|
||||
key: ${{ runner.os }}-debian-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-debian-
|
||||
|
||||
- name: Build and push Debian
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
boky/postfix:latest-debian
|
||||
boky/postfix:${{ env.RELEASE_VERSION }}-debian
|
||||
boky/postfix:${{ env.RELEASE_VERSION_NO_v }}-debian
|
||||
platforms: "linux/386,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/amd64,linux/arm64,linux/mips64le,linux/ppc64le,linux/s390x"
|
||||
cache-from: type=local,src=/tmp/.buildx-cache/debian,mode=max,compression=estargz
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new/debian
|
||||
build-args: |
|
||||
BASE_IMAGE=debian:bookworm
|
||||
|
||||
- name: Move cache
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
|
||||
|
||||
Release:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# syntax=docker/dockerfile:1.2
|
||||
|
||||
ARG BASE_IMAGE=alpine:latest
|
||||
ARG BASE_IMAGE=debian:latest
|
||||
# ARG BASE_IMAGE=ubuntu:jammy
|
||||
|
||||
FROM ${BASE_IMAGE} AS build-scripts
|
||||
|
|
|
|||
|
|
@ -130,6 +130,9 @@ Several potentially "surprising" changes went into this issue and hence warrant
|
|||
- Image now builds its own version of [postfix-exporter](https://github.com/kumina/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:
|
||||
`linux/386`, `linux/amd64`, `linux/arm/v5`, `linux/arm/v6`, `linux/arm/v7`, `linux/arm64`, `linux/arm64/v8`, `linux/mips64le`,
|
||||
`linux/ppc64le` and `linux/s390x`.
|
||||
|
||||
### v3.0.0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -f /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
fi
|
||||
|
||||
do_alpine() {
|
||||
apk update
|
||||
|
|
@ -11,13 +14,17 @@ do_alpine() {
|
|||
}
|
||||
|
||||
do_ubuntu() {
|
||||
RELEASE_SPECIFIC_PACKAGES="netcat"
|
||||
if [ "${ID}" -eq "debian" ]; then
|
||||
RELEASE_SPECIFIC_PACKAGES="netcat-openbsd"
|
||||
fi
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
echo "Europe/Berlin" > /etc/timezone
|
||||
apt-get update -y -q
|
||||
apt-get install -y libsasl2-modules
|
||||
apt-get install -y postfix
|
||||
apt-get install -y opendkim
|
||||
apt-get install -y ca-certificates tzdata supervisor rsyslog bash opendkim-tools curl libcurl4 libjsoncpp25 sasl2-bin postfix-lmdb netcat logrotate cron
|
||||
apt-get install -y ca-certificates tzdata supervisor rsyslog bash opendkim-tools curl libcurl4 libjsoncpp25 sasl2-bin postfix-lmdb logrotate cron
|
||||
}
|
||||
|
||||
if [ -f /etc/alpine-release ]; then
|
||||
|
|
|
|||
|
|
@ -19,13 +19,14 @@ do_build() {
|
|||
}
|
||||
|
||||
if [ -f /etc/alpine-release ]; then
|
||||
apk add --upgrade --virtual .build-deps git cmake clang make gcc g++ libc-dev pkgconfig curl-dev jsoncpp-dev cyrus-sasl-dev patch
|
||||
apk add --upgrade --virtual .build-deps git cmake clang make gcc g++ libc-dev pkgconfig curl-dev jsoncpp-dev cyrus-sasl-dev patch pandoc
|
||||
do_build
|
||||
apk del .build-deps;
|
||||
else
|
||||
. /etc/lsb-release
|
||||
[ -f /etc/lsb-release ] && . /etc/lsb-release
|
||||
[ -f /etc/os-release ] && . /etc/os-release
|
||||
apt-get update -y -qq
|
||||
LIBS="git build-essential cmake pkg-config libcurl4-openssl-dev libssl-dev libjsoncpp-dev libsasl2-dev"
|
||||
LIBS="git build-essential cmake pkg-config libcurl4-openssl-dev libssl-dev libjsoncpp-dev libsasl2-dev pandoc"
|
||||
apt-get install -y --no-install-recommends ${LIBS}
|
||||
do_build
|
||||
apt-get remove --purge -y ${LIBS}
|
||||
|
|
|
|||
2
build.sh
2
build.sh
|
|
@ -41,5 +41,5 @@ fi
|
|||
# arg_list="$arg_list --platform linux/amd64,linux/arm64,linux/arm/v7"
|
||||
#fi
|
||||
|
||||
docker buildx build ${arg_list} . $*
|
||||
docker buildx build ${arg_list} $* .
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue