Skip to content

Commit e0fd4ec

Browse files
mlocatiNicoHaase
andauthored
Build containers for PHP > 8.1 (#5)
* Build containers for PHP > 8.1 * Use PHP 8.4 GA, not rc * Fix apt for old Debian versions * Update action versions --------- Co-authored-by: Nico Haase <[email protected]>
1 parent 3aeefd0 commit e0fd4ec

File tree

3 files changed

+56
-12
lines changed

3 files changed

+56
-12
lines changed

.github/workflows/create-images.yml

+29-10
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
echo 'Docker images will be published'
3232
PUBLISH_IMAGES=yes
3333
fi
34-
echo "::set-output name=result::$PUBLISH_IMAGES"
34+
echo "result=$PUBLISH_IMAGES" >> $GITHUB_OUTPUT
3535
3636
build-base-images:
3737
name: PHP ${{ matrix.php-version }}
@@ -52,6 +52,7 @@ jobs:
5252
# The version of libheif to be installed - see # https://github.com/strukturag/libheif/releases
5353
LIBHEIF_VERSION: 1.12.0
5454
strategy:
55+
fail-fast: false
5556
matrix:
5657
php-version:
5758
- "5.5"
@@ -63,15 +64,18 @@ jobs:
6364
- "7.4"
6465
- "8.0"
6566
- "8.1"
67+
- "8.2"
68+
- "8.3"
69+
- "8.4"
6670
steps:
6771
-
6872
name: Checkout
69-
uses: actions/checkout@v2
73+
uses: actions/checkout@v4
7074
-
7175
name: Create initial image
7276
run: |
7377
PHP_VERSION_DOCKERSUFFIX=''
74-
if [ "${{ matrix.php-version }}" = '8.1' ]; then
78+
if [ "${{ matrix.php-version }}" = '8.5' ]; then
7579
PHP_VERSION_DOCKERSUFFIX='-rc'
7680
fi
7781
docker build \
@@ -87,6 +91,12 @@ jobs:
8791
-
8892
name: Start container
8993
run: docker start imagine-${{ matrix.php-version }}
94+
-
95+
name: Temp
96+
run: docker exec -t imagine-${{ matrix.php-version }} ls -al /usr/local/bin/
97+
-
98+
name: Fix apt
99+
run: docker exec -t imagine-${{ matrix.php-version }} imagine-fix-apt
90100
-
91101
name: Update apt cache
92102
run: docker exec -t imagine-${{ matrix.php-version }} apt-get update -q
@@ -112,8 +122,8 @@ jobs:
112122
else
113123
HEIC_SUPPORT=no
114124
fi
115-
echo "::set-output name=avif-support::$AVIF_SUPPORT"
116-
echo "::set-output name=heic-support::$HEIC_SUPPORT"
125+
echo "avif-support=$AVIF_SUPPORT" >> $GITHUB_OUTPUT
126+
echo "heic-support=$HEIC_SUPPORT" >> $GITHUB_OUTPUT
117127
-
118128
name: Install git
119129
run: docker exec -t imagine-${{ matrix.php-version }} imagine-install git $GIT_VERSION
@@ -172,14 +182,14 @@ jobs:
172182
-
173183
name: Upload image
174184
if: needs.inspect.outputs.publish == 'no'
175-
uses: actions/upload-artifact@v2
185+
uses: actions/upload-artifact@v4
176186
with:
177187
name: base-image-${{ matrix.php-version }}
178188
path: /tmp/base-image-${{ matrix.php-version }}.tgz
179189
-
180190
name: Login to the container registry
181191
if: needs.inspect.outputs.publish == 'yes'
182-
uses: docker/login-action@v1
192+
uses: docker/login-action@v3
183193
with:
184194
registry: ghcr.io
185195
username: ${{ github.actor }}
@@ -227,17 +237,26 @@ jobs:
227237
- php-version: "8.1"
228238
graphicsmagic-version: "1.3.36"
229239
imagemagick-version: "7.1.0-8"
240+
- php-version: "8.2"
241+
graphicsmagic-version: "1.3.36"
242+
imagemagick-version: "7.1.0-8"
243+
- php-version: "8.3"
244+
graphicsmagic-version: "1.3.36"
245+
imagemagick-version: "7.1.0-8"
246+
- php-version: "8.4"
247+
graphicsmagic-version: "1.3.36"
248+
imagemagick-version: "7.1.0-8"
230249
extensions:
231250
- "gd-gmagick"
232251
- "gd-imagick"
233252
steps:
234253
-
235254
name: Checkout
236-
uses: actions/checkout@v2
255+
uses: actions/checkout@v4
237256
-
238257
name: Download base image
239258
if: needs.inspect.outputs.publish == 'no'
240-
uses: actions/download-artifact@v2
259+
uses: actions/download-artifact@v4
241260
with:
242261
name: base-image-${{ matrix.config.php-version }}
243262
path: /tmp/
@@ -301,7 +320,7 @@ jobs:
301320
-
302321
name: Login to the container registry
303322
if: needs.inspect.outputs.publish == 'yes'
304-
uses: docker/login-action@v1
323+
uses: docker/login-action@v3
305324
with:
306325
registry: ghcr.io
307326
username: ${{ github.actor }}

docker/Dockerfile.base

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ARG PHP_VERSION
33

44
# The suffix of the Docker image to be appended to PHP_VERSION
5-
# Example: "-rc" for php:8.1-rc-cli
5+
# Example: "-rc" for php:8.5-rc-cli
66
ARG PHP_VERSION_DOCKERSUFFIX=""
77

88
FROM php:${PHP_VERSION}${PHP_VERSION_DOCKERSUFFIX}-cli
@@ -11,4 +11,6 @@ COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr
1111

1212
COPY imagine-utilities /usr/local/bin/
1313

14-
COPY imagine-install /usr/local/bin/
14+
COPY --chmod=0777 imagine-install /usr/local/bin/
15+
16+
COPY --chmod=0777 imagine-fix-apt /usr/local/bin/

docker/imagine-fix-apt

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
if grep -q 'VERSION="8 (jessie)"' /etc/os-release; then
4+
distro=jessie
5+
elif grep -q 'VERSION="9 (stretch)"' /etc/os-release; then
6+
distro=stretch
7+
else
8+
exit 0
9+
fi
10+
11+
deb_archive=http://archive.kernel.org/debian-archive
12+
deb_archive_security=http://archive.kernel.org/debian-archive/debian-security
13+
sed -ri "s;^(\s*deb\s+http://(httpredir|deb).debian.org/debian\s+$distro-updates\b.*);#\1;" /etc/apt/sources.list
14+
sed -ri "s;^(\s*deb\s+)http://(httpredir|deb).debian.org;\1$deb_archive;" /etc/apt/sources.list
15+
sed -ri "s;^(\s*deb\s+)http://security.debian.org/debian-security;\1$deb_archive_security;" /etc/apt/sources.list
16+
sed -ri "s;^(\s*deb\s+)http://security.debian.org;\1$deb_archive_security;" /etc/apt/sources.list
17+
18+
tmp="$(mktemp)"
19+
DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$tmp"
20+
if grep -qE ' KEYEXPIRED [0-9]' "$tmp"; then
21+
printf 'APT::Get::AllowUnauthenticated "true";\n' >/etc/apt/apt.conf.d/99unauthenticated
22+
fi
23+
rm "$tmp"

0 commit comments

Comments
 (0)