Skip to content

Commit

Permalink
BR-11851: Make Shadow and basefdir compatible with PHP84
Browse files Browse the repository at this point in the history
  • Loading branch information
dshchyhlo-sugarcrm committed Dec 6, 2024
1 parent a97ccfe commit 392b580
Showing 1 changed file with 59 additions and 11 deletions.
70 changes: 59 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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}
Expand Down

0 comments on commit 392b580

Please sign in to comment.