From 392b580e0cac94d8c5bb314915bc76d1f7cc6e1d Mon Sep 17 00:00:00 2001 From: Dzmitry Shchyhlo Date: Fri, 6 Dec 2024 14:47:48 +0100 Subject: [PATCH] BR-11851: Make Shadow and basefdir compatible with PHP84 --- Dockerfile | 70 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9c81975..2f17e7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,68 @@ -FROM amazonlinux:2 +FROM amazonlinux:2023 ARG PHP_BUILD_DIR=/var/task ARG PHP_CONF_DIR=/etc/php.d ARG PHP_EXT_DIR=/usr/lib64/php/modules +ARG PHP_VERSION=8.4.1 -RUN yum install -y amazon-linux-extras -RUN amazon-linux-extras enable php8.2 -RUN amazon-linux-extras install -y php8.2 -RUN yum clean all && \ - yum -y upgrade && \ - yum -y install ilibzip-dev libonig-dev putils gcc make \ - yum -y re2c \ - yum-utils +RUN yum install -y \ + gcc \ + make \ + autoconf \ + bison \ + re2c \ + libxml2-devel \ + libzip-devel \ + oniguruma-devel \ + curl-devel \ + libpng-devel \ + libjpeg-devel \ + freetype-devel \ + openssl-devel \ + sqlite-devel \ + bzip2-devel \ + libcurl-devel \ + libicu-devel \ + libxslt-devel \ + libffi-devel \ + systemd-devel \ + git \ + tar \ + wget \ + && yum clean all -RUN yum -y install php-cli php-common php-devel && \ - yum clean all +RUN wget https://www.php.net/distributions/php-${PHP_VERSION}.tar.gz \ + && tar -xzf php-${PHP_VERSION}.tar.gz -C /usr/local/src \ + && rm php-${PHP_VERSION}.tar.gz + +RUN cd /usr/local/src/php-${PHP_VERSION} \ + && ./configure \ + --prefix=/usr/local/php \ + --with-config-file-path=/usr/local/php/etc \ + --with-config-file-scan-dir=/usr/local/php/etc/conf.d \ + --enable-mbstring \ + --with-curl \ + --with-openssl \ + --with-zlib \ + --enable-bcmath \ + --enable-mbregex \ + --enable-pcntl \ + --enable-sockets \ + --with-mysqli \ + --with-pdo-mysql \ + --with-pdo-sqlite \ + --with-zip \ + --with-gd \ + --with-jpeg \ + --with-freetype \ + --enable-opcache \ + --enable-fpm \ + && make -j"$(nproc)" \ + && make install + +RUN ln -s /usr/local/php/bin/php /usr/bin/php \ + && ln -s /usr/local/php/bin/phpize /usr/bin/phpize \ + && ln -s /usr/local/php/bin/php-config /usr/bin/php-config #Extension install RUN mkdir -p ${PHP_EXT_DIR} && mkdir -p ${PHP_CONF_DIR}