From fd6ceace704b02955d33a8c6201da3cef7f756c9 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 8 Oct 2021 08:32:03 +0200 Subject: [PATCH 1/4] Rename installer and keep it in the final images --- .github/workflows/create-images.yml | 28 +++++++++++----------- docker/Dockerfile.base | 4 ++-- docker/{installer.sh => imagine-install} | 8 +------ docker/{utilities.sh => imagine-utilities} | 0 4 files changed, 17 insertions(+), 23 deletions(-) rename docker/{installer.sh => imagine-install} (98%) rename docker/{utilities.sh => imagine-utilities} (100%) diff --git a/.github/workflows/create-images.yml b/.github/workflows/create-images.yml index d806f73..1438029 100644 --- a/.github/workflows/create-images.yml +++ b/.github/workflows/create-images.yml @@ -97,13 +97,13 @@ jobs: name: Inspect container environment id: inspect run: | - if docker exec -t imagine-${{ matrix.php-version }} /installer.sh support-avif; then + if docker exec -t imagine-${{ matrix.php-version }} imagine-install support-avif; then echo 'AVIF is supported' AVIF_SUPPORT=yes else AVIF_SUPPORT=no fi - if docker exec -t imagine-${{ matrix.php-version }} /installer.sh support-heic; then + if docker exec -t imagine-${{ matrix.php-version }} imagine-install support-heic; then echo 'HEIC is supported' HEIC_SUPPORT=yes else @@ -113,31 +113,31 @@ jobs: echo "::set-output name=heic-support::$HEIC_SUPPORT" - name: Install git - run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh git $GIT_VERSION + run: docker exec -t imagine-${{ matrix.php-version }} imagine-install git $GIT_VERSION - name: Install libaom ${{ env.LIBAOM_VERSION }} if: ${{ steps.inspect.outputs.avif-support == 'yes' || steps.inspect.outputs.heic-support == 'yes' }} - run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh libaom $LIBAOM_VERSION + run: docker exec -t imagine-${{ matrix.php-version }} imagine-install libaom $LIBAOM_VERSION - name: Install libdav1d ${{ env.LIBDAV1D_VERSION }} if: ${{ steps.inspect.outputs.avif-support == 'yes' }} - run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh libdav1d $LIBDAV1D_VERSION + run: docker exec -t imagine-${{ matrix.php-version }} imagine-install libdav1d $LIBDAV1D_VERSION - name: Install libyuv if: ${{ steps.inspect.outputs.avif-support == 'yes' || steps.inspect.outputs.heic-support == 'yes' }} - run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh libyuv + run: docker exec -t imagine-${{ matrix.php-version }} imagine-install libyuv - name: Install libavif ${{ env.LIBAVIF_VERSION }} if: ${{ steps.inspect.outputs.avif-support == 'yes' }} - run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh libavif $LIBAVIF_VERSION + run: docker exec -t imagine-${{ matrix.php-version }} imagine-install libavif $LIBAVIF_VERSION - name: Install libde265 ${{ env.LIBDE265_VERSION }} if: ${{ steps.inspect.outputs.heic-support == 'yes' }} - run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh libde265 $LIBDE265_VERSION + run: docker exec -t imagine-${{ matrix.php-version }} imagine-install libde265 $LIBDE265_VERSION - name: Install libheif ${{ env.LIBHEIF_VERSION }} if: ${{ steps.inspect.outputs.heic-support == 'yes' }} - run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh libheif $LIBHEIF_VERSION + run: docker exec -t imagine-${{ matrix.php-version }} imagine-install libheif $LIBHEIF_VERSION - name: Install Composer run: docker exec -t -e IPE_KEEP_SYSPKG_CACHE=1 imagine-${{ matrix.php-version }} install-php-extensions @composer-2 @@ -149,7 +149,7 @@ jobs: run: docker exec -t imagine-${{ matrix.php-version }} php --ri exif - name: Cleanup - run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh cleanup + run: docker exec -t imagine-${{ matrix.php-version }} imagine-install cleanup - name: Check container run: docker container ls -s --filter name=imagine-${{ matrix.php-version }} @@ -251,7 +251,7 @@ jobs: - name: Install GraphicsMagic if: ${{ contains(format('-{0}-', matrix.extensions), '-gmagick-') }} - run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} /installer.sh graphicsmagick ${{ matrix.config.graphicsmagic-version }} + run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} imagine-install graphicsmagick ${{ matrix.config.graphicsmagic-version }} - name: Install gmagick PHP extension if: ${{ contains(format('-{0}-', matrix.extensions), '-gmagick-') }} @@ -263,7 +263,7 @@ jobs: - name: Install ImageMagick if: ${{ contains(format('-{0}-', matrix.extensions), '-imagick-') }} - run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} /installer.sh imagemagick ${{ matrix.config.imagemagick-version }} + run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} imagine-install imagemagick ${{ matrix.config.imagemagick-version }} - name: Install imagick PHP extension if: ${{ contains(format('-{0}-', matrix.extensions), '-imagick-') }} @@ -281,8 +281,8 @@ jobs: if: ${{ contains(format('-{0}-', matrix.extensions), '-gd-') }} run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} php --ri gd - - name: Final cleanup - run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} /installer.sh final-cleanup + name: Cleanup + run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} imagine-install cleanup - name: Check container run: docker container ls -s --filter name=imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 6f0efd0..22a6052 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -9,6 +9,6 @@ FROM php:${PHP_VERSION}${PHP_VERSION_DOCKERSUFFIX}-cli COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ -COPY utilities.sh / +COPY imagine-utilities /usr/local/bin/ -COPY installer.sh / +COPY imagine-install /usr/local/bin/ diff --git a/docker/installer.sh b/docker/imagine-install similarity index 98% rename from docker/installer.sh rename to docker/imagine-install index d33d6a3..5aa7490 100755 --- a/docker/installer.sh +++ b/docker/imagine-install @@ -3,7 +3,7 @@ set -o nounset set -o errexit -. "$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)/utilities.sh" +. "$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)/imagine-utilities" # Install git. # If it's too old to be used in GitHub Actions we'll build it. @@ -410,15 +410,9 @@ case "$1" in installImagemagick "$2" ;; cleanup) - uninstallAptDevPackages - rm -rf /var/lib/apt/lists/* - ;; - final-cleanup) uninstallAptDevPackages rm -rf /var/lib/apt/lists/* rm -rf /tmp/* - unlink "$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)/utilities.sh" - unlink "$0" ;; *) printf 'Unrecognized command: "%s"\n' "$1">&2 diff --git a/docker/utilities.sh b/docker/imagine-utilities similarity index 100% rename from docker/utilities.sh rename to docker/imagine-utilities From cf82a5096d7bec02c8ddab04d4222adcd2462408 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 8 Oct 2021 08:48:51 +0200 Subject: [PATCH 2/4] Install xdebug (without enabling it) --- .github/workflows/create-images.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/create-images.yml b/.github/workflows/create-images.yml index 1438029..baa18cd 100644 --- a/.github/workflows/create-images.yml +++ b/.github/workflows/create-images.yml @@ -141,6 +141,9 @@ jobs: - name: Install Composer run: docker exec -t -e IPE_KEEP_SYSPKG_CACHE=1 imagine-${{ matrix.php-version }} install-php-extensions @composer-2 + - + name: Install xdebug PHP extension (without enabling it) + run: docker exec -t -e IPE_KEEP_SYSPKG_CACHE=1 -e IPE_DONT_ENABLE=1 imagine-${{ matrix.php-version }} install-php-extensions xdebug - name: Install exif PHP extension run: docker exec -t -e IPE_KEEP_SYSPKG_CACHE=1 imagine-${{ matrix.php-version }} install-php-extensions exif From 2682c23c6aca82e51d764a51919aafe849d313bd Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 8 Oct 2021 08:48:27 +0200 Subject: [PATCH 3/4] Fix Let's Encrypt CA issue --- .github/workflows/create-images.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/create-images.yml b/.github/workflows/create-images.yml index baa18cd..b7512f9 100644 --- a/.github/workflows/create-images.yml +++ b/.github/workflows/create-images.yml @@ -93,6 +93,9 @@ jobs: - name: Update apt packages run: docker exec -t imagine-${{ matrix.php-version }} apt-get upgrade -qy + - + name: Fix Let's Encrypt CA certificate + run: docker exec -t -e IPE_KEEP_SYSPKG_CACHE=1 imagine-${{ matrix.php-version }} install-php-extensions @fix_letsencrypt - name: Inspect container environment id: inspect From e4432ae7bd2265d311d24453bd28f076594ca7dd Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 8 Oct 2021 10:34:29 +0200 Subject: [PATCH 4/4] Try different URLs to fetch GraphicsMagick --- docker/imagine-install | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/docker/imagine-install b/docker/imagine-install index 5aa7490..1015f1a 100755 --- a/docker/imagine-install +++ b/docker/imagine-install @@ -325,9 +325,25 @@ installGraphicsmagick() { installAptPackages \ "^libz[0-9\-]*$ ^libjpeg[0-9]*-turbo ^libpng[0-9\-]*$ ^libjbig[0-9\-]*$ ^libtiff[0-9]*$ ^libwebp[0-9]*$ ^libwebpdemux[0-9]*$ ^libwebpmux[0-9]*$ libxml2 ^liblcms2[0-9\-]*$ ^libfreetype[0-9]*$ $installGraphicsmagick_zstd" \ "libbz2-dev ^libjpeg[0-9]*-turbo-dev libpng-dev libjbig-dev libtiff-dev libwebp-dev libxml2-dev liblcms2-dev ^libfreetype[0-9]*-dev$ $installGraphicsmagick_zstdDev" - printf 'Downloading GraphicsMagick v%s... ' "$1" + installGraphicsmagick_url="http://ftp.icm.edu.pl/pub/unix/graphics/GraphicsMagick/${1%.*}/GraphicsMagick-$1.tar.gz" + if ! curl -ksLfI -o /dev/null $installGraphicsmagick_url; then + installGraphicsmagick_url="ftp://ftp.icm.edu.pl/pub/unix/graphics/GraphicsMagick/${1%.*}/GraphicsMagick-$1.tar.gz" + if ! curl -ksLfI -o /dev/null $installGraphicsmagick_url; then + installGraphicsmagick_url="http://78.108.103.11/MIRROR/ftp/GraphicsMagick/${1%.*}/GraphicsMagick-$1.tar.gz" + if ! curl -ksLfI -o /dev/null $installGraphicsmagick_url; then + installGraphicsmagick_url="http://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick/$1/GraphicsMagick-$1.tar.gz" + if ! curl -ksLfI -o /dev/null $installGraphicsmagick_url; then + installGraphicsmagick_url="http://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick-history/${1%.*}/GraphicsMagick-$1.tar.gz" + if ! curl -ksLfI -o /dev/null $installGraphicsmagick_url; then + installGraphicsmagick_url="ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/${1%.*}/GraphicsMagick-$1.tar.gz" + fi + fi + fi + fi + fi + printf 'Downloading GraphicsMagick v%s from %s... ' "$1" "$installGraphicsmagick_url" installGraphicsmagick_dir="$(mktemp -d)" - curl -ksSLf -o - http://ftp.icm.edu.pl/pub/unix/graphics/GraphicsMagick/${1%.*}/GraphicsMagick-$1.tar.gz | tar xzm -C "$installGraphicsmagick_dir" + curl -ksSLf -o - "$installGraphicsmagick_url" | tar xzm -C "$installGraphicsmagick_dir" printf 'done.\n' cd "$installGraphicsmagick_dir/GraphicsMagick-$1" CFLAGS='-Wno-misleading-indentation -Wno-unused-const-variable -Wno-pointer-compare -Wno-tautological-compare' ./configure --disable-static --enable-shared