From 16ae1618f6177132434c3ad5df9ed9b8c10a3b36 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 5 Nov 2025 17:45:12 +0100 Subject: [PATCH] fix: consolidate build dependencies before PHP extension installation Fixes Docker build failure when upgrading to PHP 8.3+ with sockets extension. The issue occurred because build tools (gcc, make, autoconf) were being installed after attempting to compile PHP extensions, causing the build to fail with exit code 2. Changes: - Consolidated all dependencies in single RUN command with --no-cache - Added linux-headers, autoconf, build-base before extension compilation - Added sockets extension to docker-php-ext-install - Upgraded default PHP version from 8.1 to 8.3 This ensures build tools are available before pecl/docker-php-ext-install attempts to compile extensions. --- docker/Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index c372469b8..2f3611836 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,12 +1,11 @@ -ARG PHP=8.1 +ARG PHP=8.3 FROM php:${PHP}-cli-alpine -RUN apk update && apk add \ - zip libzip-dev icu-dev git +RUN apk update && apk add --no-cache \ + zip libzip-dev icu-dev git \ + linux-headers autoconf build-base -RUN docker-php-ext-install zip intl - -RUN apk add --no-cache linux-headers autoconf build-base +RUN docker-php-ext-install zip intl sockets RUN pecl install xdebug RUN docker-php-ext-enable xdebug COPY --from=composer:2 /usr/bin/composer /usr/bin/composer