Skip to content

Commit 59d13e7

Browse files
committed
Update PHP version in build script and adjust opcache handling for PHP 8.5
1 parent 1c6b9d6 commit 59d13e7

File tree

2 files changed

+69
-51
lines changed

2 files changed

+69
-51
lines changed

build-images.sh

Lines changed: 57 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -13,56 +13,65 @@ reponame="webserver"
1313
podman build \
1414
--force-rm \
1515
--layers \
16-
--tag "${repobase}/php8.4-fpm" \
17-
--build-arg "PHP_VERSION_IMAGE=docker.io/library/php:8.4.15-fpm-bookworm" \
16+
--tag "${repobase}/php8.5-fpm" \
17+
--build-arg "PHP_VERSION_IMAGE=docker.io/library/php:8.5.1-fpm-bookworm" \
1818
container
1919

20-
images+=("${repobase}/php8.4-fpm")
21-
22-
podman build \
23-
--force-rm \
24-
--layers \
25-
--tag "${repobase}/php8.3-fpm" \
26-
--build-arg "PHP_VERSION_IMAGE=docker.io/library/php:8.3.28-fpm-bookworm" \
27-
container
28-
29-
images+=("${repobase}/php8.3-fpm")
30-
31-
podman build \
32-
--force-rm \
33-
--layers \
34-
--tag "${repobase}/php8.2-fpm" \
35-
--build-arg "PHP_VERSION_IMAGE=docker.io/library/php:8.2.29-fpm-bookworm" \
36-
container
37-
38-
images+=("${repobase}/php8.2-fpm")
39-
40-
podman build \
41-
--force-rm \
42-
--layers \
43-
--tag "${repobase}/php8.1-fpm" \
44-
--build-arg "PHP_VERSION_IMAGE=docker.io/library/php:8.1.33-fpm-bookworm" \
45-
container
46-
47-
images+=("${repobase}/php8.1-fpm")
48-
49-
podman build \
50-
--force-rm \
51-
--layers \
52-
--tag "${repobase}/php8.0-fpm" \
53-
--build-arg "PHP_VERSION_IMAGE=docker.io/library/php:8.0.30-fpm-bullseye" \
54-
container
55-
56-
images+=("${repobase}/php8.0-fpm")
57-
58-
podman build \
59-
--force-rm \
60-
--layers \
61-
--tag "${repobase}/php7.4-fpm" \
62-
--build-arg "PHP_VERSION_IMAGE=docker.io/library/php:7.4.33-fpm-bullseye" \
63-
container
64-
65-
images+=("${repobase}/php7.4-fpm")
20+
images+=("${repobase}/php8.5-fpm")
21+
22+
# podman build \
23+
# --force-rm \
24+
# --layers \
25+
# --tag "${repobase}/php8.4-fpm" \
26+
# --build-arg "PHP_VERSION_IMAGE=docker.io/library/php:8.4.15-fpm-bookworm" \
27+
# container
28+
29+
# images+=("${repobase}/php8.4-fpm")
30+
31+
# podman build \
32+
# --force-rm \
33+
# --layers \
34+
# --tag "${repobase}/php8.3-fpm" \
35+
# --build-arg "PHP_VERSION_IMAGE=docker.io/library/php:8.3.28-fpm-bookworm" \
36+
# container
37+
38+
# images+=("${repobase}/php8.3-fpm")
39+
40+
# podman build \
41+
# --force-rm \
42+
# --layers \
43+
# --tag "${repobase}/php8.2-fpm" \
44+
# --build-arg "PHP_VERSION_IMAGE=docker.io/library/php:8.2.29-fpm-bookworm" \
45+
# container
46+
47+
# images+=("${repobase}/php8.2-fpm")
48+
49+
# podman build \
50+
# --force-rm \
51+
# --layers \
52+
# --tag "${repobase}/php8.1-fpm" \
53+
# --build-arg "PHP_VERSION_IMAGE=docker.io/library/php:8.1.33-fpm-bookworm" \
54+
# container
55+
56+
# images+=("${repobase}/php8.1-fpm")
57+
58+
# podman build \
59+
# --force-rm \
60+
# --layers \
61+
# --tag "${repobase}/php8.0-fpm" \
62+
# --build-arg "PHP_VERSION_IMAGE=docker.io/library/php:8.0.30-fpm-bullseye" \
63+
# container
64+
65+
# images+=("${repobase}/php8.0-fpm")
66+
67+
# podman build \
68+
# --force-rm \
69+
# --layers \
70+
# --tag "${repobase}/php7.4-fpm" \
71+
# --build-arg "PHP_VERSION_IMAGE=docker.io/library/php:7.4.33-fpm-bullseye" \
72+
# container
73+
74+
# images+=("${repobase}/php7.4-fpm")
6675

6776
# Create a new empty container image
6877
container=$(buildah from scratch)

container/Containerfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ ARG PHP_EXTENSIONS="\
4949
intl \
5050
ldap \
5151
mysqli \
52-
opcache \
5352
pcntl \
5453
pdo_mysql \
5554
pdo_pgsql \
@@ -106,6 +105,11 @@ RUN set -eux \
106105
\
107106
&& docker-php-ext-install -j"$(nproc)" $PHP_EXTENSIONS \
108107
\
108+
# --- Handle opcache depending on PHP version (skip for 8.5.x) ---
109+
&& if ! echo "$PHP_VERSION_IMAGE" | grep -q "8.5"; then \
110+
docker-php-ext-install -j"$(nproc)" opcache; \
111+
fi \
112+
\
109113
# --- Handle IMAP depending on PHP version ---
110114
&& if php -r 'exit(version_compare(PHP_VERSION,"8.4.0","<")?0:1);'; then \
111115
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
@@ -153,5 +157,10 @@ RUN set -eux \
153157
done
154158

155159
# --- Custom PHP configs ---
156-
COPY docker-php-ext-opcache.ini /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
157-
COPY docker-php-ext-imap.ini /usr/local/etc/php/conf.d/docker-php-ext-imap.ini
160+
&& if ! php -r 'exit(version_compare(PHP_VERSION,"8.5.0",">=")?0:1);'; then \
161+
cp /docker-php-ext-opcache.ini /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini; \
162+
fi \
163+
&& cp /docker-php-ext-imap.ini /usr/local/etc/php/conf.d/docker-php-ext-imap.ini
164+
165+
COPY docker-php-ext-opcache.ini /docker-php-ext-opcache.ini
166+
COPY docker-php-ext-imap.ini /usr/local/etc/php/conf.d/docker-php-ext-imap.ini

0 commit comments

Comments
 (0)