Skip to content

Commit d33e51d

Browse files
committed
Fix Laravel 9 build fails for PHP 8.2
Problem: The image fails to build stating that the base image does not exist. Cause: Laravel9.x is extending Laravel8.x, which is no longer built with PHP 8.2 as it does not support it. Fix: Extend Composer instead of Laravel8.x.
1 parent cae4f0a commit d33e51d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

laravel9.x.docker

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# chekote/laravel9.x:php${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}.${PHP_PATCH_VERSION}
55
# chekote/laravel9.x:php${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}.${PHP_PATCH_VERSION}-$(date '+%Y-%m-%d-%H-%M-%S')
66
ARG PHP_VERSION=8.0
7-
FROM chekote/laravel8.x:php${PHP_VERSION}
7+
FROM chekote/composer:php${PHP_VERSION}
88

99
ENV SUPPORTED_LARAVEL_VERSION '9.x'
1010
ENV MIN_PHP_VERSION '8.0'
@@ -16,11 +16,17 @@ RUN set -eu; \
1616
apt-get update; \
1717
apt-get install -y --no-install-recommends \
1818
#
19-
# Laravel requirements (beyond base image).
19+
# Laravel requirements
2020
# See https://laravel.com/docs/9.x/deployment#server-requirements
2121
# See https://github.com/laravel/laravel/blob/9.x/composer.json
22+
php${PHP_VERSION}-ctype \
2223
php${PHP_VERSION}-curl \
2324
php${PHP_VERSION}-dom; \
25+
php${PHP_VERSION}-mbstring \
26+
# php${PHP_VERSION}-openssl \ (already included)
27+
php${PHP_VERSION}-pdo \
28+
php${PHP_VERSION}-tokenizer \
29+
php${PHP_VERSION}-xml; \
2430
#
2531
# Cleanup
2632
apt-get autoremove -y; \

0 commit comments

Comments
 (0)