ARG OS_VERSION=9.5 FROM quay.io/teras/almalinux:${OS_VERSION}-minimal ARG PHP_VERSION=8.4 ARG PHP_LONG_VERSION=8.4.7 ARG COMPOSER_VERSION=2.8.9 ENV PHP_VERSION=${PHP_VERSION} ENV COMPOSER_VERSION=${COMPOSER_VERSION} ENV SERVER_ROOT=/app ENV PHP_DEPS \ tar gzip \ gcc gcc-c++ make autoconf bison make ENV PHP_INI_DIR=/etc/php WORKDIR /tmp ADD https://www.php.net/distributions/php-${PHP_LONG_VERSION}.tar.gz /tmp/php-src.tar.gz RUN /sbin/groupadd -g 10000 php; \ /sbin/useradd -u 10000 -g 10000 -s /bin/sh -d ${SERVER_ROOT} php; \ /bin/microdnf -y --nodocs install ${PHP_DEPS}; \ /bin/tar -xzf /tmp/php-src.tar.gz -C /usr/src; # /bin/mkdir -p ${SERVER_ROOT}; \ # /sbin/groupadd -g 10000 php; \ # /sbin/useradd -u 10000 -g 10000 -s /bin/sh -d ${SERVER_ROOT} php; \ # /bin/chown -R php:php ${SERVER_ROOT}; \ # /bin/microdnf -y --nodocs install epel-release; \ # /bin/microdnf -y upgrade; \ # /bin/rpm -Uvh --replacepkgs --replacefiles \ # https://rpms.remirepo.net/enterprise/remi-release-9.rpm; \ # /bin/microdnf -y module reset php; \ # /bin/microdnf -y module enable php:remi-${PHP_VERSION}; \ # /bin/microdnf -y --nodocs install \ # php php-cli php-common php-phar \ # php-iconv php-mbstring php-json; # ADD https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar /usr/local/bin/composer # RUN /bin/chown php:php /usr/local/bin/composer; \ # /bin/chmod +rx /usr/local/bin/composer; \ # /bin/microdnf clean all; \ # /bin/rm -rf /var/cache/yum/*; \ # /bin/rm -rf /var/lib/yum/history/*; \ # /bin/rm -rf /var/lib/yum/yumdb/*; \ # /bin/rm -rf /var/lib/dnf/*; # Create symlinks to /usr/bin/php in case it doesn't exists # RUN ln -ns /usr/bin/php${PHP_VERSION} /usr/bin/php; exit 0 # WORKDIR ${SERVER_ROOT} # USER php # CMD ["/usr/bin/php", "-v"] CMD ["/bin/sh"] STOPSIGNAL SIGQUIT