Skip to content

Commit 3aeefd0

Browse files
authored
Merge pull request #3 from mlocati/add-xdebug-keep-installer
Install xdebug and keep imagine installer in final images
2 parents 400e53e + e4432ae commit 3aeefd0

File tree

4 files changed

+41
-25
lines changed

4 files changed

+41
-25
lines changed

.github/workflows/create-images.yml

+20-14
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,20 @@ jobs:
9393
-
9494
name: Update apt packages
9595
run: docker exec -t imagine-${{ matrix.php-version }} apt-get upgrade -qy
96+
-
97+
name: Fix Let's Encrypt CA certificate
98+
run: docker exec -t -e IPE_KEEP_SYSPKG_CACHE=1 imagine-${{ matrix.php-version }} install-php-extensions @fix_letsencrypt
9699
-
97100
name: Inspect container environment
98101
id: inspect
99102
run: |
100-
if docker exec -t imagine-${{ matrix.php-version }} /installer.sh support-avif; then
103+
if docker exec -t imagine-${{ matrix.php-version }} imagine-install support-avif; then
101104
echo 'AVIF is supported'
102105
AVIF_SUPPORT=yes
103106
else
104107
AVIF_SUPPORT=no
105108
fi
106-
if docker exec -t imagine-${{ matrix.php-version }} /installer.sh support-heic; then
109+
if docker exec -t imagine-${{ matrix.php-version }} imagine-install support-heic; then
107110
echo 'HEIC is supported'
108111
HEIC_SUPPORT=yes
109112
else
@@ -113,34 +116,37 @@ jobs:
113116
echo "::set-output name=heic-support::$HEIC_SUPPORT"
114117
-
115118
name: Install git
116-
run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh git $GIT_VERSION
119+
run: docker exec -t imagine-${{ matrix.php-version }} imagine-install git $GIT_VERSION
117120
-
118121
name: Install libaom ${{ env.LIBAOM_VERSION }}
119122
if: ${{ steps.inspect.outputs.avif-support == 'yes' || steps.inspect.outputs.heic-support == 'yes' }}
120-
run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh libaom $LIBAOM_VERSION
123+
run: docker exec -t imagine-${{ matrix.php-version }} imagine-install libaom $LIBAOM_VERSION
121124
-
122125
name: Install libdav1d ${{ env.LIBDAV1D_VERSION }}
123126
if: ${{ steps.inspect.outputs.avif-support == 'yes' }}
124-
run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh libdav1d $LIBDAV1D_VERSION
127+
run: docker exec -t imagine-${{ matrix.php-version }} imagine-install libdav1d $LIBDAV1D_VERSION
125128
-
126129
name: Install libyuv
127130
if: ${{ steps.inspect.outputs.avif-support == 'yes' || steps.inspect.outputs.heic-support == 'yes' }}
128-
run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh libyuv
131+
run: docker exec -t imagine-${{ matrix.php-version }} imagine-install libyuv
129132
-
130133
name: Install libavif ${{ env.LIBAVIF_VERSION }}
131134
if: ${{ steps.inspect.outputs.avif-support == 'yes' }}
132-
run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh libavif $LIBAVIF_VERSION
135+
run: docker exec -t imagine-${{ matrix.php-version }} imagine-install libavif $LIBAVIF_VERSION
133136
-
134137
name: Install libde265 ${{ env.LIBDE265_VERSION }}
135138
if: ${{ steps.inspect.outputs.heic-support == 'yes' }}
136-
run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh libde265 $LIBDE265_VERSION
139+
run: docker exec -t imagine-${{ matrix.php-version }} imagine-install libde265 $LIBDE265_VERSION
137140
-
138141
name: Install libheif ${{ env.LIBHEIF_VERSION }}
139142
if: ${{ steps.inspect.outputs.heic-support == 'yes' }}
140-
run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh libheif $LIBHEIF_VERSION
143+
run: docker exec -t imagine-${{ matrix.php-version }} imagine-install libheif $LIBHEIF_VERSION
141144
-
142145
name: Install Composer
143146
run: docker exec -t -e IPE_KEEP_SYSPKG_CACHE=1 imagine-${{ matrix.php-version }} install-php-extensions @composer-2
147+
-
148+
name: Install xdebug PHP extension (without enabling it)
149+
run: docker exec -t -e IPE_KEEP_SYSPKG_CACHE=1 -e IPE_DONT_ENABLE=1 imagine-${{ matrix.php-version }} install-php-extensions xdebug
144150
-
145151
name: Install exif PHP extension
146152
run: docker exec -t -e IPE_KEEP_SYSPKG_CACHE=1 imagine-${{ matrix.php-version }} install-php-extensions exif
@@ -149,7 +155,7 @@ jobs:
149155
run: docker exec -t imagine-${{ matrix.php-version }} php --ri exif
150156
-
151157
name: Cleanup
152-
run: docker exec -t imagine-${{ matrix.php-version }} /installer.sh cleanup
158+
run: docker exec -t imagine-${{ matrix.php-version }} imagine-install cleanup
153159
-
154160
name: Check container
155161
run: docker container ls -s --filter name=imagine-${{ matrix.php-version }}
@@ -251,7 +257,7 @@ jobs:
251257
-
252258
name: Install GraphicsMagic
253259
if: ${{ contains(format('-{0}-', matrix.extensions), '-gmagick-') }}
254-
run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} /installer.sh graphicsmagick ${{ matrix.config.graphicsmagic-version }}
260+
run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} imagine-install graphicsmagick ${{ matrix.config.graphicsmagic-version }}
255261
-
256262
name: Install gmagick PHP extension
257263
if: ${{ contains(format('-{0}-', matrix.extensions), '-gmagick-') }}
@@ -263,7 +269,7 @@ jobs:
263269
-
264270
name: Install ImageMagick
265271
if: ${{ contains(format('-{0}-', matrix.extensions), '-imagick-') }}
266-
run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} /installer.sh imagemagick ${{ matrix.config.imagemagick-version }}
272+
run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} imagine-install imagemagick ${{ matrix.config.imagemagick-version }}
267273
-
268274
name: Install imagick PHP extension
269275
if: ${{ contains(format('-{0}-', matrix.extensions), '-imagick-') }}
@@ -281,8 +287,8 @@ jobs:
281287
if: ${{ contains(format('-{0}-', matrix.extensions), '-gd-') }}
282288
run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} php --ri gd
283289
-
284-
name: Final cleanup
285-
run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} /installer.sh final-cleanup
290+
name: Cleanup
291+
run: docker exec -t imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }} imagine-install cleanup
286292
-
287293
name: Check container
288294
run: docker container ls -s --filter name=imagine-${{ matrix.config.php-version }}-${{ matrix.extensions }}

docker/Dockerfile.base

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ FROM php:${PHP_VERSION}${PHP_VERSION_DOCKERSUFFIX}-cli
99

1010
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
1111

12-
COPY utilities.sh /
12+
COPY imagine-utilities /usr/local/bin/
1313

14-
COPY installer.sh /
14+
COPY imagine-install /usr/local/bin/

docker/installer.sh renamed to docker/imagine-install

+19-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -o nounset
44
set -o errexit
55

6-
. "$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)/utilities.sh"
6+
. "$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)/imagine-utilities"
77

88
# Install git.
99
# If it's too old to be used in GitHub Actions we'll build it.
@@ -325,9 +325,25 @@ installGraphicsmagick() {
325325
installAptPackages \
326326
"^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" \
327327
"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"
328-
printf 'Downloading GraphicsMagick v%s... ' "$1"
328+
installGraphicsmagick_url="http://ftp.icm.edu.pl/pub/unix/graphics/GraphicsMagick/${1%.*}/GraphicsMagick-$1.tar.gz"
329+
if ! curl -ksLfI -o /dev/null $installGraphicsmagick_url; then
330+
installGraphicsmagick_url="ftp://ftp.icm.edu.pl/pub/unix/graphics/GraphicsMagick/${1%.*}/GraphicsMagick-$1.tar.gz"
331+
if ! curl -ksLfI -o /dev/null $installGraphicsmagick_url; then
332+
installGraphicsmagick_url="http://78.108.103.11/MIRROR/ftp/GraphicsMagick/${1%.*}/GraphicsMagick-$1.tar.gz"
333+
if ! curl -ksLfI -o /dev/null $installGraphicsmagick_url; then
334+
installGraphicsmagick_url="http://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick/$1/GraphicsMagick-$1.tar.gz"
335+
if ! curl -ksLfI -o /dev/null $installGraphicsmagick_url; then
336+
installGraphicsmagick_url="http://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick-history/${1%.*}/GraphicsMagick-$1.tar.gz"
337+
if ! curl -ksLfI -o /dev/null $installGraphicsmagick_url; then
338+
installGraphicsmagick_url="ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/${1%.*}/GraphicsMagick-$1.tar.gz"
339+
fi
340+
fi
341+
fi
342+
fi
343+
fi
344+
printf 'Downloading GraphicsMagick v%s from %s... ' "$1" "$installGraphicsmagick_url"
329345
installGraphicsmagick_dir="$(mktemp -d)"
330-
curl -ksSLf -o - http://ftp.icm.edu.pl/pub/unix/graphics/GraphicsMagick/${1%.*}/GraphicsMagick-$1.tar.gz | tar xzm -C "$installGraphicsmagick_dir"
346+
curl -ksSLf -o - "$installGraphicsmagick_url" | tar xzm -C "$installGraphicsmagick_dir"
331347
printf 'done.\n'
332348
cd "$installGraphicsmagick_dir/GraphicsMagick-$1"
333349
CFLAGS='-Wno-misleading-indentation -Wno-unused-const-variable -Wno-pointer-compare -Wno-tautological-compare' ./configure --disable-static --enable-shared
@@ -410,15 +426,9 @@ case "$1" in
410426
installImagemagick "$2"
411427
;;
412428
cleanup)
413-
uninstallAptDevPackages
414-
rm -rf /var/lib/apt/lists/*
415-
;;
416-
final-cleanup)
417429
uninstallAptDevPackages
418430
rm -rf /var/lib/apt/lists/*
419431
rm -rf /tmp/*
420-
unlink "$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)/utilities.sh"
421-
unlink "$0"
422432
;;
423433
*)
424434
printf 'Unrecognized command: "%s"\n' "$1">&2
File renamed without changes.

0 commit comments

Comments
 (0)