php7 and php8 images
This commit is contained in:
16
php-fpm/7/Dockerfile
Normal file
16
php-fpm/7/Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM centos:7
|
||||
RUN yum update -y
|
||||
RUN yum install epel-release -y
|
||||
RUN rpm -i https://rpms.remirepo.net/enterprise/remi-release-7.rpm
|
||||
RUN yum install php74 php74-php-fpm php74-php-pdo php74-php-mysqlnd php74-php-bcmath php74-php-devel php74-php-gd php74-php-mbstring php74-php-pear php74-php-pecl-zip php74-php-xml -y
|
||||
RUN yum clean all
|
||||
COPY docker-entrypoint.sh /
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["/opt/remi/php74/root/usr/sbin/php-fpm"]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
32
php-fpm/7/docker-entrypoint.sh
Normal file
32
php-fpm/7/docker-entrypoint.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
if [[ (! -z "${PHP_DAEMON_USER}" ) && ( "${PHP_DAEMON_USER}" != "root" ) ]]; then
|
||||
useradd -r -s /bin/false $PHP_DAEMON_USER
|
||||
if [[ ! -z "${PHP_DAEMON_USER_UID}" ]]; then
|
||||
usermod -u $PHP_DAEMON_USER_UID $PHP_DAEMON_USER
|
||||
fi
|
||||
if [[ ! -z "${PHP_DAEMON_USER_GID}" ]]; then
|
||||
groupmod -g $PHP_DAEMON_USER_GID $PHP_DAEMON_USER
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -d "/var/opt/remi/php74/lib/php/session" ]; then
|
||||
mkdir -p /var/opt/remi/php74/lib/php/session
|
||||
fi
|
||||
|
||||
cp /etc/opt/remi/php74/php.ini /etc/opt/remi/php74/php-tmp.ini
|
||||
cp /etc/opt/remi/php74/php-fpm.conf /etc/opt/remi/php74/php-fpm-tmp.conf
|
||||
|
||||
if [[ ! -z "${PHP_DAEMON_USER}" ]]; then
|
||||
sed -i "s/^user = .*/user = ${PHP_DAEMON_USER}/" /etc/opt/remi/php74/php-fpm-tmp.conf
|
||||
sed -i "s/^group = .*/group = ${PHP_DAEMON_USER}/" /etc/opt/remi/php74/php-fpm-tmp.conf
|
||||
chown -R $(id -u ${PHP_DAEMON_USER}):$(id -g ${PHP_DAEMON_USER}) /var/opt/remi/php74/lib/php/session
|
||||
|
||||
fi
|
||||
|
||||
"$@" "--nodaemonize" --fpm-config /etc/opt/remi/php74/php-fpm-tmp.conf --php-ini /etc/opt/remi/php74/php-tmp.ini
|
||||
|
||||
|
||||
|
||||
|
||||
16
php-fpm/8/Dockerfile
Normal file
16
php-fpm/8/Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM centos:7
|
||||
RUN yum update -y
|
||||
RUN yum install epel-release -y
|
||||
RUN rpm -i https://rpms.remirepo.net/enterprise/remi-release-7.rpm
|
||||
RUN yum install php80 php80-php-fpm php80-php-pdo php80-php-mysqlnd php80-php-bcmath php80-php-devel php80-php-gd php80-php-mbstring php80-php-pear php80-php-pecl-zip php80-php-xml -y
|
||||
RUN yum clean all
|
||||
COPY docker-entrypoint.sh /
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["/opt/remi/php80/root/usr/sbin/php-fpm"]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
32
php-fpm/8/docker-entrypoint.sh
Normal file
32
php-fpm/8/docker-entrypoint.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
if [[ (! -z "${PHP_DAEMON_USER}" ) && ( "${PHP_DAEMON_USER}" != "root" ) ]]; then
|
||||
useradd -r -s /bin/false $PHP_DAEMON_USER
|
||||
if [[ ! -z "${PHP_DAEMON_USER_UID}" ]]; then
|
||||
usermod -u $PHP_DAEMON_USER_UID $PHP_DAEMON_USER
|
||||
fi
|
||||
if [[ ! -z "${PHP_DAEMON_USER_GID}" ]]; then
|
||||
groupmod -g $PHP_DAEMON_USER_GID $PHP_DAEMON_USER
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -d "/var/opt/remi/php80/lib/php/session" ]; then
|
||||
mkdir -p /var/opt/remi/php80/lib/php/session
|
||||
fi
|
||||
|
||||
cp /etc/opt/remi/php80/php.ini /etc/opt/remi/php80/php-tmp.ini
|
||||
cp /etc/opt/remi/php80/php-fpm.conf /etc/opt/remi/php80/php-fpm-tmp.conf
|
||||
|
||||
if [[ ! -z "${PHP_DAEMON_USER}" ]]; then
|
||||
sed -i "s/^user = .*/user = ${PHP_DAEMON_USER}/" /etc/opt/remi/php80/php-fpm-tmp.conf
|
||||
sed -i "s/^group = .*/group = ${PHP_DAEMON_USER}/" /etc/opt/remi/php80/php-fpm-tmp.conf
|
||||
chown -R $(id -u ${PHP_DAEMON_USER}):$(id -g ${PHP_DAEMON_USER}) /var/opt/remi/php80/lib/php/session
|
||||
|
||||
fi
|
||||
|
||||
"$@" "--nodaemonize" --fpm-config /etc/opt/remi/php80/php-fpm-tmp.conf --php-ini /etc/opt/remi/php80/php-tmp.ini
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user