From 70ad0d6954fd588ba19649377672791c13a9e6e9 Mon Sep 17 00:00:00 2001 From: Nico Haase Date: Fri, 29 Nov 2024 14:08:40 +0100 Subject: [PATCH 1/4] Build containers for PHP > 8.1 --- .github/workflows/create-images.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/create-images.yml b/.github/workflows/create-images.yml index b7512f9..3e4dec7 100644 --- a/.github/workflows/create-images.yml +++ b/.github/workflows/create-images.yml @@ -31,7 +31,7 @@ jobs: echo 'Docker images will be published' PUBLISH_IMAGES=yes fi - echo "::set-output name=result::$PUBLISH_IMAGES" + echo "result=$PUBLISH_IMAGES" >> $GITHUB_OUTPUT build-base-images: name: PHP ${{ matrix.php-version }} @@ -52,6 +52,7 @@ jobs: # The version of libheif to be installed - see # https://github.com/strukturag/libheif/releases LIBHEIF_VERSION: 1.12.0 strategy: + fail-fast: false matrix: php-version: - "5.5" @@ -63,15 +64,18 @@ jobs: - "7.4" - "8.0" - "8.1" + - "8.2" + - "8.3" + - "8.4" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Create initial image run: | PHP_VERSION_DOCKERSUFFIX='' - if [ "${{ matrix.php-version }}" = '8.1' ]; then + if [ "${{ matrix.php-version }}" = '8.4' ]; then PHP_VERSION_DOCKERSUFFIX='-rc' fi docker build \ @@ -112,8 +116,8 @@ jobs: else HEIC_SUPPORT=no fi - echo "::set-output name=avif-support::$AVIF_SUPPORT" - echo "::set-output name=heic-support::$HEIC_SUPPORT" + echo "avif-support=$AVIF_SUPPORT" >> $GITHUB_OUTPUT + echo "heic-support=$HEIC_SUPPORT" >> $GITHUB_OUTPUT - name: Install git run: docker exec -t imagine-${{ matrix.php-version }} imagine-install git $GIT_VERSION @@ -172,7 +176,7 @@ jobs: - name: Upload image if: needs.inspect.outputs.publish == 'no' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: base-image-${{ matrix.php-version }} path: /tmp/base-image-${{ matrix.php-version }}.tgz @@ -227,6 +231,15 @@ jobs: - php-version: "8.1" graphicsmagic-version: "1.3.36" imagemagick-version: "7.1.0-8" + - php-version: "8.2" + graphicsmagic-version: "1.3.36" + imagemagick-version: "7.1.0-8" + - php-version: "8.3" + graphicsmagic-version: "1.3.36" + imagemagick-version: "7.1.0-8" + - php-version: "8.4" + graphicsmagic-version: "1.3.36" + imagemagick-version: "7.1.0-8" extensions: - "gd-gmagick" - "gd-imagick" From e0020824e51c9fdb048d9227b6ca64c81b8f6cc3 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Mon, 2 Dec 2024 20:59:13 +0100 Subject: [PATCH 2/4] Use PHP 8.4 GA, not rc --- .github/workflows/create-images.yml | 2 +- docker/Dockerfile.base | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-images.yml b/.github/workflows/create-images.yml index 3e4dec7..8ae0fbe 100644 --- a/.github/workflows/create-images.yml +++ b/.github/workflows/create-images.yml @@ -75,7 +75,7 @@ jobs: name: Create initial image run: | PHP_VERSION_DOCKERSUFFIX='' - if [ "${{ matrix.php-version }}" = '8.4' ]; then + if [ "${{ matrix.php-version }}" = '8.5' ]; then PHP_VERSION_DOCKERSUFFIX='-rc' fi docker build \ diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 22a6052..c1aaaf8 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -2,7 +2,7 @@ ARG PHP_VERSION # The suffix of the Docker image to be appended to PHP_VERSION -# Example: "-rc" for php:8.1-rc-cli +# Example: "-rc" for php:8.5-rc-cli ARG PHP_VERSION_DOCKERSUFFIX="" FROM php:${PHP_VERSION}${PHP_VERSION_DOCKERSUFFIX}-cli From 608eb63e5239edf3061828ad87cb0483c13eb391 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Mon, 2 Dec 2024 20:57:53 +0100 Subject: [PATCH 3/4] Fix apt for old Debian versions --- .github/workflows/create-images.yml | 6 ++++++ docker/Dockerfile.base | 4 +++- docker/imagine-fix-apt | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100755 docker/imagine-fix-apt diff --git a/.github/workflows/create-images.yml b/.github/workflows/create-images.yml index 8ae0fbe..adeb97f 100644 --- a/.github/workflows/create-images.yml +++ b/.github/workflows/create-images.yml @@ -91,6 +91,12 @@ jobs: - name: Start container run: docker start imagine-${{ matrix.php-version }} + - + name: Temp + run: docker exec -t imagine-${{ matrix.php-version }} ls -al /usr/local/bin/ + - + name: Fix apt + run: docker exec -t imagine-${{ matrix.php-version }} imagine-fix-apt - name: Update apt cache run: docker exec -t imagine-${{ matrix.php-version }} apt-get update -q diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index c1aaaf8..01cb994 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -11,4 +11,6 @@ COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr COPY imagine-utilities /usr/local/bin/ -COPY imagine-install /usr/local/bin/ +COPY --chmod=0777 imagine-install /usr/local/bin/ + +COPY --chmod=0777 imagine-fix-apt /usr/local/bin/ diff --git a/docker/imagine-fix-apt b/docker/imagine-fix-apt new file mode 100755 index 0000000..d94f91e --- /dev/null +++ b/docker/imagine-fix-apt @@ -0,0 +1,23 @@ +#!/bin/sh + +if grep -q 'VERSION="8 (jessie)"' /etc/os-release; then + distro=jessie +elif grep -q 'VERSION="9 (stretch)"' /etc/os-release; then + distro=stretch +else + exit 0 +fi + +deb_archive=http://archive.kernel.org/debian-archive +deb_archive_security=http://archive.kernel.org/debian-archive/debian-security +sed -ri "s;^(\s*deb\s+http://(httpredir|deb).debian.org/debian\s+$distro-updates\b.*);#\1;" /etc/apt/sources.list +sed -ri "s;^(\s*deb\s+)http://(httpredir|deb).debian.org;\1$deb_archive;" /etc/apt/sources.list +sed -ri "s;^(\s*deb\s+)http://security.debian.org/debian-security;\1$deb_archive_security;" /etc/apt/sources.list +sed -ri "s;^(\s*deb\s+)http://security.debian.org;\1$deb_archive_security;" /etc/apt/sources.list + +tmp="$(mktemp)" +DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$tmp" +if grep -qE ' KEYEXPIRED [0-9]' "$tmp"; then + printf 'APT::Get::AllowUnauthenticated "true";\n' >/etc/apt/apt.conf.d/99unauthenticated +fi +rm "$tmp" From c98a2a4077c910fce826a77fa2ec68179867b6b6 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 3 Dec 2024 11:04:19 +0100 Subject: [PATCH 4/4] Update action versions --- .github/workflows/create-images.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-images.yml b/.github/workflows/create-images.yml index adeb97f..5f00101 100644 --- a/.github/workflows/create-images.yml +++ b/.github/workflows/create-images.yml @@ -189,7 +189,7 @@ jobs: - name: Login to the container registry if: needs.inspect.outputs.publish == 'yes' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} @@ -252,11 +252,11 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Download base image if: needs.inspect.outputs.publish == 'no' - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: base-image-${{ matrix.config.php-version }} path: /tmp/ @@ -320,7 +320,7 @@ jobs: - name: Login to the container registry if: needs.inspect.outputs.publish == 'yes' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }}