From 18ac39ad9c104197fad5459fbed6e5a038f8abc5 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Mon, 22 Dec 2025 12:27:32 +0100 Subject: [PATCH] Install APCU via pie in php dev docker image --- Dockerfile | 4 ++-- data/infra/php.Dockerfile | 11 +---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index d741d15c..b75ec607 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,12 +15,12 @@ WORKDIR /etc/shlink # Install required PHP extensions RUN \ - # Temp install dev dependencies needed to compile the extensions + # Temp install dev dependencies needed to compile the extensions \ apk add --no-cache --virtual .dev-deps sqlite-dev postgresql-dev icu-dev libzip-dev zlib-dev linux-headers && \ docker-php-ext-install -j"$(nproc)" pdo_mysql pdo_pgsql intl calendar sockets bcmath zip && \ apk add --no-cache sqlite-libs && \ docker-php-ext-install -j"$(nproc)" pdo_sqlite && \ - # Remove temp dev extensions, and install prod equivalents that are required at runtime + # Remove temp dev extensions, and install prod equivalents that are required at runtime \ apk del .dev-deps && \ apk add --no-cache postgresql icu libzip libpng diff --git a/data/infra/php.Dockerfile b/data/infra/php.Dockerfile index 16f9bcef..162ca3ab 100644 --- a/data/infra/php.Dockerfile +++ b/data/infra/php.Dockerfile @@ -32,19 +32,10 @@ COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS linux-headers && \ docker-php-ext-install sockets && \ pie install xdebug/xdebug && \ + pie install apcu/apcu && \ apk del .phpize-deps RUN docker-php-ext-install bcmath -# Install APCu extension -ADD https://pecl.php.net/get/apcu-$APCU_VERSION.tgz /tmp/apcu.tar.gz -RUN mkdir -p /usr/src/php/ext/apcu \ - && tar xf /tmp/apcu.tar.gz -C /usr/src/php/ext/apcu --strip-components=1 \ - && docker-php-ext-configure apcu \ - && docker-php-ext-install apcu \ - && rm /tmp/apcu.tar.gz \ - && rm /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini \ - && echo extension=apcu.so > /usr/local/etc/php/conf.d/20-php-ext-apcu.ini - # Install sqlsrv driver RUN apk add --update linux-headers && \ wget https://download.microsoft.com/download/${MS_ODBC_DOWNLOAD}/msodbcsql${MS_ODBC_SQL_VERSION}-1_amd64.apk && \