From 76b56114b567d536e50c7deace2a3af12dee1ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Cap=C3=B3?= Date: Sun, 10 Aug 2025 11:07:45 +0200 Subject: [PATCH] add weekly build, change to trixie and clean up --- .gitea/workflows/weekly-build.yml | 50 +++++++++++++++++++++++++++++++ Dockerfile-php | 12 ++------ build.sh | 5 ---- 3 files changed, 52 insertions(+), 15 deletions(-) create mode 100644 .gitea/workflows/weekly-build.yml diff --git a/.gitea/workflows/weekly-build.yml b/.gitea/workflows/weekly-build.yml new file mode 100644 index 0000000..fd84bbb --- /dev/null +++ b/.gitea/workflows/weekly-build.yml @@ -0,0 +1,50 @@ +name: Weekly Docker Image Rebuild + +on: + schedule: + - cron: '0 2 * * 0' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Container Registry + uses: docker/login-action@v3 + with: + registry: git.paucapo.com + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Build and push PHP images + run: | + PHP_VERSIONS="7.4 8.0 8.1 8.2" + PLATFORMS="linux/arm64/v8,linux/amd64" + + docker buildx create --use --platform=linux/arm64/v8,linux/amd64 --name multi-platform-builder + docker buildx inspect --bootstrap + + for PHP_VERSION in ${PHP_VERSIONS}; do + echo "Building php:${PHP_VERSION}" + docker buildx build \ + --no-cache \ + --platform=${PLATFORMS} \ + --push \ + -f "./Dockerfile-php" \ + -t "git.paucapo.com/server/php:${PHP_VERSION}" \ + --build-arg PHP_VERSION=${PHP_VERSION} \ + . + done + + docker buildx rm multi-platform-builder --force + + - name: Cleanup + if: always() + run: | + docker image prune -a --force \ No newline at end of file diff --git a/Dockerfile-php b/Dockerfile-php index 9bba569..a8ef5bf 100644 --- a/Dockerfile-php +++ b/Dockerfile-php @@ -1,7 +1,6 @@ -FROM debian:bookworm-slim +FROM debian:trixie-slim ARG PHP_VERSION=7.4 -ARG WKHTML="" RUN apt-get update -y RUN apt-get upgrade -y @@ -19,19 +18,12 @@ RUN apt-get install -y --no-install-recommends imagemagick apache2 msmtp msmtp-m php${PHP_VERSION}-imagick php${PHP_VERSION}-intl php${PHP_VERSION}-mbstring \ php${PHP_VERSION}-mysql php${PHP_VERSION}-opcache php${PHP_VERSION}-readline php${PHP_VERSION}-sqlite3 \ php${PHP_VERSION}-xml php${PHP_VERSION}-yaml php${PHP_VERSION}-zip php${PHP_VERSION}-apcu \ + php${PHP_VERSION}-redis \ libapache2-mod-php${PHP_VERSION} # specific PHP modules for some versions RUN if [[ "${PHP_VERSION}" == "7.4" ]] ; then apt-get -y install php${PHP_VERSION}-json; fi -# install wkhtml if needed -RUN if [[ "${WKHTML}" != "" ]] ; then \ - apt-get install -y --no-install-recommends libfreetype6-dev libjpeg62-turbo-dev libpng-dev fontconfig libfreetype6 libjpeg62-turbo \ - libpng16-16 libx11-6 libxcb1 libxext6 libxrender1 xfonts-75dpi xfonts-base; \ - curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_arm64.deb -o /tmp/wkhtmltox.deb; \ - dpkg -i /tmp/wkhtmltox.deb; \ - fi - # upgrade system a second time RUN apt-get upgrade -y diff --git a/build.sh b/build.sh index 13a5e96..9d34044 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,6 @@ #!/bin/bash PHP_VERSIONS="7.4 8.0 8.1 8.2" -WKHTML="" PLATFORMS="linux/arm64/v8,linux/amd64" # testing @@ -36,10 +35,6 @@ for PHP_VERSION in ${PHP_VERSIONS}; do build ${PHP_VERSION} ${PHP_VERSION} done -for PHP_VERSION in ${WKHTML}; do - build "${PHP_VERSION}-wkhtml" "${PHP_VERSION}" "--build-arg WKHTML=1" -done - docker buildx rm multi-platform-builder --force docker image prune -a --force