Skip to content

Instantly share code, notes, and snippets.

@nansenat16
Last active November 30, 2024 13:49
Show Gist options
  • Save nansenat16/9abbe437f665308cb6bcf1192a1d203b to your computer and use it in GitHub Desktop.
Save nansenat16/9abbe437f665308cb6bcf1192a1d203b to your computer and use it in GitHub Desktop.
centos8-stream build php8.3.14 with gcc13 on docker
FROM quay.io/centos/centos:stream8
WORKDIR /tmp
ENV PHP_VERSION=8.3.14
SHELL ["/bin/bash", "-c"]
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \
sed -i s/^#.*baseurl=http/baseurl=https/g /etc/yum.repos.d/*.repo && \
sed -i s/^mirrorlist=http/#mirrorlist=https/g /etc/yum.repos.d/*.repo && \
# centos8 built issue
# https://github.com/php/php-src/issues/12774
yum install -y scl-utils gcc-toolset-13 && \
# php depend
yum install -y pcre-devel libxml2-devel net-snmp-devel sqlite-devel postgresql-devel && \
curl https://www.php.net/distributions/php-${PHP_VERSION}.tar.gz -o php.tgz && \
tar -xzf php.tgz
# https://docs.redhat.com/en/documentation/red_hat_software_collections/3/html/packaging_guide/sect-enabling_the_software_collection#sect-Enabling_the_Software_Collection
RUN cd php-${PHP_VERSION} && \
source /opt/rh/gcc-toolset-13/enable && \
./configure --with-snmp --enable-sockets --with-openssl --with-pgsql --with-pdo-pgsql --enable-mbstring --disable-mbregex --with-config-file-path=/app/config --disable-cgi --enable-fpm --enable-static && \
make -j4 && \
make install
#make test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment