docker/php (sha256:48fda26b6d96e343701d9c4285f234abce22382725622216694cc7ad5e878357)

Published 2026-01-03 23:23:22 +00:00 by geusebio in Grey.ooo/docker

Installation

docker pull git.grey.ooo/grey.ooo/docker/php@sha256:48fda26b6d96e343701d9c4285f234abce22382725622216694cc7ad5e878357
sha256:48fda26b6d96e343701d9c4285f234abce22382725622216694cc7ad5e878357

About this package

PHP 8.1 base image

Image layers

ADD alpine-minirootfs-3.18.12-x86_64.tar.gz / # buildkit
CMD ["/bin/sh"]
ENV ALPINE_VERSION=3.18
ARG BASE_PACKAGES= bash bash-completion pv bc btop less util-linux-misc util-linux-bash-completion bind-tools iputils-ping net-tools traceroute git openssh-client ca-certificates wget curl tar gzip xz bzip2 cronie flock nano vim figlet ncurses runuser runit dos2unix patch
LABEL org.opencontainers.image.vendor=Grey.ooo org.opencontainers.image.authors=Matt B <matt@grey.ooo> org.opencontainers.image.url=https://git.grey.ooo/Grey.ooo/docker org.opencontainers.image.source=https://git.grey.ooo/Grey.ooo/docker org.opencontainers.image.documentation=https://git.grey.ooo/Grey.ooo/docker/src/branch/main/README.md ooo.grey.version.alpine=3.18
ENV TERM=xterm-256color PATH=/app:/app/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin LOG_PATHS= SVDIR=/etc/services.d SVWAIT=5 PAGER=/usr/bin/less EDITOR=/usr/bin/nano SYSTEM_USER=app
WORKDIR /app
RUN |1 BASE_PACKAGES= bash bash-completion pv bc btop less util-linux-misc util-linux-bash-completion bind-tools iputils-ping net-tools traceroute git openssh-client ca-certificates wget curl tar gzip xz bzip2 cronie flock nano vim figlet ncurses runuser runit dos2unix patch /bin/sh -c set -ue apk add --no-cache $BASE_PACKAGES # add our app user adduser -D -u 1000 $SYSTEM_USER -h /home -s /bin/bash chown -R $SYSTEM_USER:$SYSTEM_USER /app # We're about to add the root filesystem and I want to clean house of these runit-related directories before I do so. rm -Rf /etc/service /etc/services /etc/services.d \ /etc/periodic /etc/cron.d \ /etc/conf.d # buildkit
SHELL [/bin/bash -ce]
COPY ./fs/alpine/. / # buildkit
RUN |1 BASE_PACKAGES= bash bash-completion pv bc btop less util-linux-misc util-linux-bash-completion bind-tools iputils-ping net-tools traceroute git openssh-client ca-certificates wget curl tar gzip xz bzip2 cronie flock nano vim figlet ncurses runuser runit dos2unix patch /bin/bash -ce # Install lolcat from the edge/testing repo. # This is a workaround for the fact that lolcat is not available in the stable repo. # It lets us have nice colourful banners. apk add --no-cache lolcat --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing # buildkit
STOPSIGNAL SIGHUP
CMD ["/usr/local/bin/entrypoint"]
RUN |1 BASE_PACKAGES= bash bash-completion pv bc btop less util-linux-misc util-linux-bash-completion bind-tools iputils-ping net-tools traceroute git openssh-client ca-certificates wget curl tar gzip xz bzip2 cronie flock nano vim figlet ncurses runuser runit dos2unix patch /bin/bash -ce rm /root/.bashrc /root/.profile /home/.bashrc /home/.profile /etc/profile.d/00-bashrc.sh >/dev/null 2>&1 || true ln -s /etc/profile /root/.bashrc ln -s /etc/profile /root/.profile ln -s /etc/profile /home/.bashrc ln -s /etc/profile /home/.profile sed -i 's|/bin/ash|/bin/bash|' /etc/passwd sv-fix-perms /usr/local/bin/validate # buildkit
ARG NGINX_VERSION=1.24
ARG PHP_VERSION=8.1
ARG COMPOSER_VERSION=2.2.25
ARG PHP_PACKAGES=php81 php81-bcmath php81-bz2 php81-calendar php81-ctype php81-curl php81-dom php81-exif php81-fileinfo php81-ftp php81-fpm php81-gd php81-gettext php81-gmp php81-iconv php81-imap php81-intl php81-ldap php81-mbstring php81-mysqli php81-mysqlnd php81-odbc php81-opcache php81-openssl php81-pcntl php81-pdo php81-pdo_dblib php81-pdo_mysql php81-pdo_odbc php81-pdo_pgsql php81-pdo_sqlite php81-pgsql php81-phar php81-posix php81-session php81-shmop php81-simplexml php81-snmp php81-soap php81-sockets php81-sodium php81-sqlite3 php81-sysvmsg php81-sysvsem php81-sysvshm php81-tidy php81-tokenizer php81-xml php81-xmlreader php81-xmlwriter php81-xsl php81-zip php81-zlib php81-pecl-apcu php81-pecl-redis php81-pecl-msgpack php81-pecl-xdebug
ARG EXTRA_PACKAGES=nginx sqlite postgresql-client mysql-client mariadb-connector-c redis
ENV PHP_VERSION=8.1 NGINX_VERSION=1.24 COMPOSER_VERSION=2.2.25 COMPOSER_ALLOW_SUPERUSER=1 COMPOSER_HOME=/var/cache/.composer COMPOSER_FUND=0 PATH=/app/vendor/bin:/app:/app/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PHP_MEMORY_LIMIT=256M PHP_CLI_MEMORY_LIMIT=4096M PHP_ERROR_REPORTING=E_ALL PHP_DISPLAY_ERRORS=1 LOG_PATHS=/var/log/nginx_access.log /var/log/nginx_error.log /var/log/php_access.log /var/log/php_error.log
LABEL ooo.grey.version.php=8.1 ooo.grey.version.nginx=1.24 ooo.grey.version.composer=2.2.25
RUN |6 BASE_PACKAGES= bash bash-completion pv bc btop less util-linux-misc util-linux-bash-completion bind-tools iputils-ping net-tools traceroute git openssh-client ca-certificates wget curl tar gzip xz bzip2 cronie flock nano vim figlet ncurses runuser runit dos2unix patch NGINX_VERSION=1.24 PHP_VERSION=8.1 COMPOSER_VERSION=2.2.25 PHP_PACKAGES=php81 php81-bcmath php81-bz2 php81-calendar php81-ctype php81-curl php81-dom php81-exif php81-fileinfo php81-ftp php81-fpm php81-gd php81-gettext php81-gmp php81-iconv php81-imap php81-intl php81-ldap php81-mbstring php81-mysqli php81-mysqlnd php81-odbc php81-opcache php81-openssl php81-pcntl php81-pdo php81-pdo_dblib php81-pdo_mysql php81-pdo_odbc php81-pdo_pgsql php81-pdo_sqlite php81-pgsql php81-phar php81-posix php81-session php81-shmop php81-simplexml php81-snmp php81-soap php81-sockets php81-sodium php81-sqlite3 php81-sysvmsg php81-sysvsem php81-sysvshm php81-tidy php81-tokenizer php81-xml php81-xmlreader php81-xmlwriter php81-xsl php81-zip php81-zlib php81-pecl-apcu php81-pecl-redis php81-pecl-msgpack php81-pecl-xdebug EXTRA_PACKAGES=nginx sqlite postgresql-client mysql-client mariadb-connector-c redis /bin/bash -ce # Install PHP+Friends apk add --no-cache $PHP_PACKAGES $EXTRA_PACKAGES # remove nginx, postgres and redis user if they exist, we didn't ask to create them but install scripts do it anyway deluser nginx || true deluser postgres || true deluser redis || true # Remove the default php config files rm /etc/php /etc/php* -Rf || true # buildkit
COPY ./fs/php-nginx/. / # buildkit
RUN |6 BASE_PACKAGES= bash bash-completion pv bc btop less util-linux-misc util-linux-bash-completion bind-tools iputils-ping net-tools traceroute git openssh-client ca-certificates wget curl tar gzip xz bzip2 cronie flock nano vim figlet ncurses runuser runit dos2unix patch NGINX_VERSION=1.24 PHP_VERSION=8.1 COMPOSER_VERSION=2.2.25 PHP_PACKAGES=php81 php81-bcmath php81-bz2 php81-calendar php81-ctype php81-curl php81-dom php81-exif php81-fileinfo php81-ftp php81-fpm php81-gd php81-gettext php81-gmp php81-iconv php81-imap php81-intl php81-ldap php81-mbstring php81-mysqli php81-mysqlnd php81-odbc php81-opcache php81-openssl php81-pcntl php81-pdo php81-pdo_dblib php81-pdo_mysql php81-pdo_odbc php81-pdo_pgsql php81-pdo_sqlite php81-pgsql php81-phar php81-posix php81-session php81-shmop php81-simplexml php81-snmp php81-soap php81-sockets php81-sodium php81-sqlite3 php81-sysvmsg php81-sysvsem php81-sysvshm php81-tidy php81-tokenizer php81-xml php81-xmlreader php81-xmlwriter php81-xsl php81-zip php81-zlib php81-pecl-apcu php81-pecl-redis php81-pecl-msgpack php81-pecl-xdebug EXTRA_PACKAGES=nginx sqlite postgresql-client mysql-client mariadb-connector-c redis /bin/bash -ce if [[ "$PHP_VERSION" == "8.5"* ]]; then echo "Disabling opcache zend_extension inclusion for PHP 8.5" # MB: Comment out "zend_extension" with a ;, its not compatible with PHP 8.5 yet. sed -i 's/^zend_extension/;zend_extension/' /etc/php/conf.d/*_opcache.ini cat /etc/php/conf.d/*_opcache.ini fi # buildkit
RUN |6 BASE_PACKAGES= bash bash-completion pv bc btop less util-linux-misc util-linux-bash-completion bind-tools iputils-ping net-tools traceroute git openssh-client ca-certificates wget curl tar gzip xz bzip2 cronie flock nano vim figlet ncurses runuser runit dos2unix patch NGINX_VERSION=1.24 PHP_VERSION=8.1 COMPOSER_VERSION=2.2.25 PHP_PACKAGES=php81 php81-bcmath php81-bz2 php81-calendar php81-ctype php81-curl php81-dom php81-exif php81-fileinfo php81-ftp php81-fpm php81-gd php81-gettext php81-gmp php81-iconv php81-imap php81-intl php81-ldap php81-mbstring php81-mysqli php81-mysqlnd php81-odbc php81-opcache php81-openssl php81-pcntl php81-pdo php81-pdo_dblib php81-pdo_mysql php81-pdo_odbc php81-pdo_pgsql php81-pdo_sqlite php81-pgsql php81-phar php81-posix php81-session php81-shmop php81-simplexml php81-snmp php81-soap php81-sockets php81-sodium php81-sqlite3 php81-sysvmsg php81-sysvsem php81-sysvshm php81-tidy php81-tokenizer php81-xml php81-xmlreader php81-xmlwriter php81-xsl php81-zip php81-zlib php81-pecl-apcu php81-pecl-redis php81-pecl-msgpack php81-pecl-xdebug EXTRA_PACKAGES=nginx sqlite postgresql-client mysql-client mariadb-connector-c redis /bin/bash -ce # Install composer curl https://getcomposer.org/download/$COMPOSER_VERSION/composer.phar --output /usr/local/bin/composer --silent chmod +x /usr/local/bin/composer # buildkit
RUN |6 BASE_PACKAGES= bash bash-completion pv bc btop less util-linux-misc util-linux-bash-completion bind-tools iputils-ping net-tools traceroute git openssh-client ca-certificates wget curl tar gzip xz bzip2 cronie flock nano vim figlet ncurses runuser runit dos2unix patch NGINX_VERSION=1.24 PHP_VERSION=8.1 COMPOSER_VERSION=2.2.25 PHP_PACKAGES=php81 php81-bcmath php81-bz2 php81-calendar php81-ctype php81-curl php81-dom php81-exif php81-fileinfo php81-ftp php81-fpm php81-gd php81-gettext php81-gmp php81-iconv php81-imap php81-intl php81-ldap php81-mbstring php81-mysqli php81-mysqlnd php81-odbc php81-opcache php81-openssl php81-pcntl php81-pdo php81-pdo_dblib php81-pdo_mysql php81-pdo_odbc php81-pdo_pgsql php81-pdo_sqlite php81-pgsql php81-phar php81-posix php81-session php81-shmop php81-simplexml php81-snmp php81-soap php81-sockets php81-sodium php81-sqlite3 php81-sysvmsg php81-sysvsem php81-sysvshm php81-tidy php81-tokenizer php81-xml php81-xmlreader php81-xmlwriter php81-xsl php81-zip php81-zlib php81-pecl-apcu php81-pecl-redis php81-pecl-msgpack php81-pecl-xdebug EXTRA_PACKAGES=nginx sqlite postgresql-client mysql-client mariadb-connector-c redis /bin/bash -ce set -ue PHP_VER=$(echo $PHP_VERSION | tr -d '.') # if PHP_VER is less than 80, set it to 7 if [[ "$PHP_VER" -lt 80 ]]; then PHP_VER=7 fi # Move some binary names around as well as other bits and pieces mkdir /run/php-fpm ln -s /etc/php /etc/php${PHP_VER} || true ln -s /usr/bin/php${PHP_VER} /usr/bin/php || true ln -s /usr/sbin/php-fpm${PHP_VER} /usr/sbin/php-fpm ln -s /usr/share/php${PHP_VER} /usr/share/php ln -s /var/log/php${PHP_VER} /var/log/php # if we're PHP 7, we need to comment out pm.max_spawn_rate in /etc/php/php-fpm.d/www.conf if [[ "$PHP_VER" -eq 7 ]]; then sed -i 's/^pm.max_spawn_rate = .*/;pm.max_spawn_rate = 20/' /etc/php/php-fpm.d/www.conf fi # Fix paths mkdir -p /var/log/nginx # Fix execution and ownership /usr/local/bin/sv-fix-perms rm -Rf \ /var/log/php/ /var/log/php*/ \ /var/log/redis \ || true touch /var/log/php_error.log /var/log/php_access.log chown app:app -R \ /app \ /var/lib/nginx /var/log/nginx /run/nginx \ /var/log/php* /run/php-fpm /usr/share/php* # json got merged into PHP in 8.0, so we remove the old json config files if [[ "$PHP_VER" -ge 80 ]]; then rm /etc/php/conf.d/*_json.ini || true fi # buildkit
USER app
RUN |6 BASE_PACKAGES= bash bash-completion pv bc btop less util-linux-misc util-linux-bash-completion bind-tools iputils-ping net-tools traceroute git openssh-client ca-certificates wget curl tar gzip xz bzip2 cronie flock nano vim figlet ncurses runuser runit dos2unix patch NGINX_VERSION=1.24 PHP_VERSION=8.1 COMPOSER_VERSION=2.2.25 PHP_PACKAGES=php81 php81-bcmath php81-bz2 php81-calendar php81-ctype php81-curl php81-dom php81-exif php81-fileinfo php81-ftp php81-fpm php81-gd php81-gettext php81-gmp php81-iconv php81-imap php81-intl php81-ldap php81-mbstring php81-mysqli php81-mysqlnd php81-odbc php81-opcache php81-openssl php81-pcntl php81-pdo php81-pdo_dblib php81-pdo_mysql php81-pdo_odbc php81-pdo_pgsql php81-pdo_sqlite php81-pgsql php81-phar php81-posix php81-session php81-shmop php81-simplexml php81-snmp php81-soap php81-sockets php81-sodium php81-sqlite3 php81-sysvmsg php81-sysvsem php81-sysvshm php81-tidy php81-tokenizer php81-xml php81-xmlreader php81-xmlwriter php81-xsl php81-zip php81-zlib php81-pecl-apcu php81-pecl-redis php81-pecl-msgpack php81-pecl-xdebug EXTRA_PACKAGES=nginx sqlite postgresql-client mysql-client mariadb-connector-c redis /bin/bash -ce set -ue mkdir -p ~/.ssh ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts # buildkit
HEALTHCHECK &{["CMD-SHELL" "/usr/local/bin/healthcheck"] "5s" "0s" "10s" "0s" '\x00'}
USER root
SHELL [/bin/bash -ce]
RUN |6 BASE_PACKAGES= bash bash-completion pv bc btop less util-linux-misc util-linux-bash-completion bind-tools iputils-ping net-tools traceroute git openssh-client ca-certificates wget curl tar gzip xz bzip2 cronie flock nano vim figlet ncurses runuser runit dos2unix patch NGINX_VERSION=1.24 PHP_VERSION=8.1 COMPOSER_VERSION=2.2.25 PHP_PACKAGES=php81 php81-bcmath php81-bz2 php81-calendar php81-ctype php81-curl php81-dom php81-exif php81-fileinfo php81-ftp php81-fpm php81-gd php81-gettext php81-gmp php81-iconv php81-imap php81-intl php81-ldap php81-mbstring php81-mysqli php81-mysqlnd php81-odbc php81-opcache php81-openssl php81-pcntl php81-pdo php81-pdo_dblib php81-pdo_mysql php81-pdo_odbc php81-pdo_pgsql php81-pdo_sqlite php81-pgsql php81-phar php81-posix php81-session php81-shmop php81-simplexml php81-snmp php81-soap php81-sockets php81-sodium php81-sqlite3 php81-sysvmsg php81-sysvsem php81-sysvshm php81-tidy php81-tokenizer php81-xml php81-xmlreader php81-xmlwriter php81-xsl php81-zip php81-zlib php81-pecl-apcu php81-pecl-redis php81-pecl-msgpack php81-pecl-xdebug EXTRA_PACKAGES=nginx sqlite postgresql-client mysql-client mariadb-connector-c redis /bin/bash -ce /usr/local/bin/validate # buildkit

Labels

Key Value
ooo.grey.version.alpine 3.18
ooo.grey.version.composer 2.2.25
ooo.grey.version.nginx 1.24
ooo.grey.version.php 8.1
org.opencontainers.image.authors Matt B <matt@grey.ooo>
org.opencontainers.image.description PHP 8.1 base image
org.opencontainers.image.documentation https://git.grey.ooo/Grey.ooo/docker/src/branch/main/README.md
org.opencontainers.image.source https://git.grey.ooo/Grey.ooo/docker
org.opencontainers.image.url https://git.grey.ooo/Grey.ooo/docker
org.opencontainers.image.vendor Grey.ooo
Details
Container
2026-01-03 23:23:22 +00:00
0
OCI / Docker
linux/amd64
Matt B <matt@grey.ooo>
71 MiB
Versions (24) View all
8.2 2026-01-03
8.3 2026-01-03