From 72792ba9569065dfbf296e735f0a53bcba38ef37 Mon Sep 17 00:00:00 2001 From: Matthias Vogel Date: Fri, 6 Nov 2026 08:51:15 +0000 Subject: [PATCH] [TASK] Add PHP 8.6 preview images on Debian trixie and Alpine Add webdevops/php, php-dev, php-nginx, php-nginx-dev, php-apache and php-apache-dev 8.6 (Debian and Alpine) based on the official PHP 8.6 release candidate images. - Debian 8.6 uses trixie: GD in PHP 8.6 needs libavif >= 1.0.0, which bookworm does not ship. PHP 8.2-8.5 stay on bookworm. - The official 8.6 images no longer bundle mbstring; build it with oniguruma. - vips and xmlrpc are not built for PHP 8.6: both are abandoned upstream and do not build against 8.6. They remain in the 8.2-8.5 images. - Install the memcached runtime library explicitly; on trixie it was removed together with the purged dev packages. Temporary workarounds until upstream releases support PHP 8.6 (marked "TODO PHP 8.6"): - release candidate base images; the version test accepts RCs for 8.6 - apcu, excimer, memcached, yaml and redis from their development branches via PIE - amqp from the unmerged fix php-amqp/php-amqp#638 (pinned commit) - protobuf: replace the removed zval_dtor() alias - Xdebug from the 3.6 pre-releases - no Tideways in the Debian 8.6 dev images: tideways-php 5.47.0 crashes PHP 8.6.0RC4 (ZTS) on startup - Alpine dev images install the Blackfire probe directly: `blackfire php:install` picks the glibc probe on Alpine with ZTS Template cleanups that avoid new distribution switches (all Debian images): - signed-by keyrings for the nginx.org and Tideways repositories instead of apt-key (removed in trixie) - bind9-dnsutils and libfreetype-dev instead of transitional packages - libc-client packages only for PHP 8.2/8.3 (imap) - oniguruma packages installed unconditionally - drop unused pre-bookworm branches --- .github/workflows/build.yaml | 1844 +++++++++++++++-- CONTRIBUTING.md | 5 +- README.md | 18 +- conf/console.yml | 4 + docker/php-apache-dev/8.2/Dockerfile | 5 +- docker/php-apache-dev/8.3/Dockerfile | 5 +- docker/php-apache-dev/8.4/Dockerfile | 5 +- docker/php-apache-dev/8.5/Dockerfile | 5 +- docker/php-apache-dev/8.6-alpine/Dockerfile | 51 + .../php-apache-dev/8.6-alpine/Dockerfile.twig | 16 + .../service.d/blackfire-agent.d/10-init.sh | 1 + .../conf/bin/service.d/blackfire-agent.sh | 25 + .../conf/etc/httpd/conf.d/02-dev.conf | 8 + .../conf/etc/httpd/vhost.common.d/.gitkeep | 0 .../conf/etc/httpd/vhost.common.d/02-dev.conf | 10 + .../etc/supervisor.d/blackfire-agent.conf | 14 + .../conf/provision/bootstrap.d/10-php.sh | 13 + .../bootstrap.d/20-php-module-opcache.sh | 10 + .../bootstrap.d/20-php-module-xdebug.sh | 12 + .../provision/entrypoint.d/10-php-debugger.sh | 82 + .../provision/entrypoint.d/20-apache-dev.sh | 5 + docker/php-apache-dev/8.6/Dockerfile | 34 + docker/php-apache-dev/8.6/Dockerfile.twig | 17 + .../service.d/blackfire-agent.d/10-init.sh | 1 + .../8.6/conf/bin/service.d/blackfire-agent.sh | 25 + .../8.6/conf/etc/httpd/conf.d/02-dev.conf | 8 + .../conf/etc/httpd/vhost.common.d/.gitkeep | 0 .../conf/etc/httpd/vhost.common.d/02-dev.conf | 10 + .../etc/supervisor.d/blackfire-agent.conf | 14 + .../8.6/conf/provision/bootstrap.d/10-php.sh | 13 + .../bootstrap.d/20-php-module-opcache.sh | 10 + .../bootstrap.d/20-php-module-xdebug.sh | 12 + .../provision/entrypoint.d/10-php-debugger.sh | 82 + .../provision/entrypoint.d/20-apache-dev.sh | 5 + docker/php-apache/8.6-alpine/Dockerfile | 33 + docker/php-apache/8.6-alpine/Dockerfile.twig | 16 + .../conf/bin/service.d/httpd.d/10-init.sh | 6 + .../8.6-alpine/conf/bin/service.d/httpd.sh | 13 + .../8.6-alpine/conf/etc/httpd/conf.d/.gitkeep | 0 .../etc/httpd/conf.d/10-error-document.conf | 15 + .../conf/etc/httpd/conf.d/10-log.conf | 4 + .../conf/etc/httpd/conf.d/10-php.conf | 37 + .../conf/etc/httpd/conf.d/10-server.conf | 18 + .../8.6-alpine/conf/etc/httpd/global.conf | 1 + .../8.6-alpine/conf/etc/httpd/main.conf | 10 + .../8.6-alpine/conf/etc/httpd/php.conf | 1 + .../8.6-alpine/conf/etc/httpd/ssl/server.crt | 28 + .../8.6-alpine/conf/etc/httpd/ssl/server.csr | 26 + .../8.6-alpine/conf/etc/httpd/ssl/server.key | 51 + .../conf/etc/httpd/vhost.common.conf | 7 + .../conf/etc/httpd/vhost.common.d/.gitkeep | 0 .../httpd/vhost.common.d/01-boilerplate.conf | 1 + .../8.6-alpine/conf/etc/httpd/vhost.conf | 36 + .../8.6-alpine/conf/etc/httpd/vhost.ssl.conf | 26 + .../conf/etc/supervisor.d/apache.conf | 14 + .../conf/provision/bootstrap.d/.gitkeep | 0 .../conf/provision/bootstrap.d/10-apache.sh | 100 + .../conf/provision/bootstrap.d/10-php.sh | 8 + .../conf/provision/entrypoint.d/.gitkeep | 0 .../conf/provision/entrypoint.d/20-apache.sh | 16 + docker/php-apache/8.6/Dockerfile | 30 + docker/php-apache/8.6/Dockerfile.twig | 17 + .../8.6/conf/bin/service.d/httpd.d/10-init.sh | 6 + .../8.6/conf/bin/service.d/httpd.sh | 14 + .../8.6/conf/etc/httpd/conf.d/.gitkeep | 0 .../etc/httpd/conf.d/10-error-document.conf | 15 + .../8.6/conf/etc/httpd/conf.d/10-log.conf | 4 + .../8.6/conf/etc/httpd/conf.d/10-php.conf | 37 + .../8.6/conf/etc/httpd/conf.d/10-server.conf | 18 + .../php-apache/8.6/conf/etc/httpd/global.conf | 1 + .../php-apache/8.6/conf/etc/httpd/main.conf | 10 + docker/php-apache/8.6/conf/etc/httpd/php.conf | 1 + .../8.6/conf/etc/httpd/ssl/server.crt | 28 + .../8.6/conf/etc/httpd/ssl/server.csr | 26 + .../8.6/conf/etc/httpd/ssl/server.key | 51 + .../8.6/conf/etc/httpd/vhost.common.conf | 7 + .../conf/etc/httpd/vhost.common.d/.gitkeep | 0 .../httpd/vhost.common.d/01-boilerplate.conf | 1 + .../php-apache/8.6/conf/etc/httpd/vhost.conf | 36 + .../8.6/conf/etc/httpd/vhost.ssl.conf | 26 + .../8.6/conf/etc/supervisor.d/apache.conf | 14 + .../8.6/conf/provision/bootstrap.d/.gitkeep | 0 .../conf/provision/bootstrap.d/10-apache.sh | 100 + .../8.6/conf/provision/bootstrap.d/10-php.sh | 8 + .../8.6/conf/provision/entrypoint.d/.gitkeep | 0 .../conf/provision/entrypoint.d/20-apache.sh | 16 + docker/php-dev/8.2/Dockerfile | 5 +- docker/php-dev/8.3/Dockerfile | 5 +- docker/php-dev/8.4/Dockerfile | 5 +- docker/php-dev/8.5/Dockerfile | 5 +- docker/php-dev/8.6-alpine/Dockerfile | 43 + docker/php-dev/8.6-alpine/Dockerfile.twig | 11 + .../service.d/blackfire-agent.d/10-init.sh | 1 + .../conf/bin/service.d/blackfire-agent.sh | 25 + .../bin/service.d/ssh.d/99-development.sh | 3 + .../etc/supervisor.d/blackfire-agent.conf | 14 + .../conf/provision/bootstrap.d/10-php.sh | 13 + .../bootstrap.d/20-php-module-opcache.sh | 10 + .../bootstrap.d/20-php-module-xdebug.sh | 12 + .../provision/bootstrap.d/99-development.sh | 5 + .../provision/entrypoint.d/10-php-debugger.sh | 82 + docker/php-dev/8.6/Dockerfile | 26 + docker/php-dev/8.6/Dockerfile.twig | 12 + .../service.d/blackfire-agent.d/10-init.sh | 1 + .../8.6/conf/bin/service.d/blackfire-agent.sh | 25 + .../bin/service.d/ssh.d/99-development.sh | 3 + .../etc/supervisor.d/blackfire-agent.conf | 14 + .../8.6/conf/provision/bootstrap.d/10-php.sh | 13 + .../bootstrap.d/20-php-module-opcache.sh | 10 + .../bootstrap.d/20-php-module-xdebug.sh | 12 + .../provision/bootstrap.d/99-development.sh | 5 + .../provision/entrypoint.d/10-php-debugger.sh | 82 + docker/php-nginx-dev/8.2/Dockerfile | 5 +- docker/php-nginx-dev/8.3/Dockerfile | 5 +- docker/php-nginx-dev/8.4/Dockerfile | 5 +- docker/php-nginx-dev/8.5/Dockerfile | 5 +- docker/php-nginx-dev/8.6-alpine/Dockerfile | 51 + .../php-nginx-dev/8.6-alpine/Dockerfile.twig | 16 + .../service.d/blackfire-agent.d/10-init.sh | 1 + .../conf/bin/service.d/blackfire-agent.sh | 25 + .../conf/etc/nginx/conf.d/02-dev.conf | 1 + .../conf/etc/nginx/vhost.common.d/.gitkeep | 0 .../conf/etc/nginx/vhost.common.d/02-dev.conf | 6 + .../conf/etc/nginx/vhost.common.d/10-log.conf | 2 + .../etc/supervisor.d/blackfire-agent.conf | 14 + .../conf/provision/bootstrap.d/.gitkeep | 0 .../conf/provision/bootstrap.d/10-nginx.sh | 6 + .../conf/provision/bootstrap.d/10-php.sh | 13 + .../bootstrap.d/20-php-module-opcache.sh | 10 + .../bootstrap.d/20-php-module-xdebug.sh | 12 + .../provision/entrypoint.d/10-php-debugger.sh | 82 + .../provision/entrypoint.d/20-nginx-dev.sh | 7 + docker/php-nginx-dev/8.6/Dockerfile | 34 + docker/php-nginx-dev/8.6/Dockerfile.twig | 17 + .../service.d/blackfire-agent.d/10-init.sh | 1 + .../8.6/conf/bin/service.d/blackfire-agent.sh | 25 + .../8.6/conf/etc/nginx/conf.d/02-dev.conf | 1 + .../conf/etc/nginx/vhost.common.d/.gitkeep | 0 .../conf/etc/nginx/vhost.common.d/02-dev.conf | 6 + .../conf/etc/nginx/vhost.common.d/10-log.conf | 2 + .../etc/supervisor.d/blackfire-agent.conf | 14 + .../8.6/conf/provision/bootstrap.d/.gitkeep | 0 .../conf/provision/bootstrap.d/10-nginx.sh | 6 + .../8.6/conf/provision/bootstrap.d/10-php.sh | 13 + .../bootstrap.d/20-php-module-opcache.sh | 10 + .../bootstrap.d/20-php-module-xdebug.sh | 12 + .../provision/entrypoint.d/10-php-debugger.sh | 82 + .../provision/entrypoint.d/20-nginx-dev.sh | 7 + docker/php-nginx/8.2/Dockerfile | 7 +- docker/php-nginx/8.3/Dockerfile | 7 +- docker/php-nginx/8.4/Dockerfile | 7 +- docker/php-nginx/8.5/Dockerfile | 7 +- docker/php-nginx/8.6-alpine/Dockerfile | 24 + docker/php-nginx/8.6-alpine/Dockerfile.twig | 17 + .../conf/bin/service.d/nginx.d/10-init.sh | 5 + .../8.6-alpine/conf/bin/service.d/nginx.sh | 10 + .../8.6-alpine/conf/etc/nginx/conf.d/.gitkeep | 0 .../conf/etc/nginx/conf.d/10-php.conf | 3 + .../8.6-alpine/conf/etc/nginx/global.conf | 1 + .../8.6-alpine/conf/etc/nginx/main.conf | 4 + .../8.6-alpine/conf/etc/nginx/nginx.conf | 34 + .../8.6-alpine/conf/etc/nginx/php.conf | 1 + .../8.6-alpine/conf/etc/nginx/ssl/server.crt | 28 + .../8.6-alpine/conf/etc/nginx/ssl/server.csr | 26 + .../8.6-alpine/conf/etc/nginx/ssl/server.key | 51 + .../conf/etc/nginx/vhost.common.conf | 2 + .../conf/etc/nginx/vhost.common.d/.gitkeep | 0 .../etc/nginx/vhost.common.d/10-general.conf | 1 + .../vhost.common.d/10-location-root.conf | 3 + .../conf/etc/nginx/vhost.common.d/10-log.conf | 2 + .../conf/etc/nginx/vhost.common.d/10-php.conf | 7 + .../8.6-alpine/conf/etc/nginx/vhost.conf | 30 + .../conf/etc/nginx/vhost.ipv6/listen-443.conf | 1 + .../conf/etc/nginx/vhost.ipv6/listen-80.conf | 1 + .../8.6-alpine/conf/etc/nginx/vhost.ssl.conf | 6 + .../conf/etc/supervisor.d/nginx.conf | 14 + .../conf/provision/bootstrap.d/.gitkeep | 0 .../conf/provision/bootstrap.d/10-nginx.sh | 38 + .../conf/provision/bootstrap.d/10-php.sh | 7 + .../conf/provision/entrypoint.d/.gitkeep | 0 .../conf/provision/entrypoint.d/20-nginx.sh | 30 + docker/php-nginx/8.6/Dockerfile | 29 + docker/php-nginx/8.6/Dockerfile.twig | 18 + .../8.6/conf/bin/service.d/nginx.d/10-init.sh | 5 + .../php-nginx/8.6/conf/bin/service.d/nginx.sh | 10 + .../8.6/conf/etc/nginx/conf.d/.gitkeep | 0 .../8.6/conf/etc/nginx/conf.d/10-php.conf | 3 + .../php-nginx/8.6/conf/etc/nginx/global.conf | 1 + docker/php-nginx/8.6/conf/etc/nginx/main.conf | 4 + docker/php-nginx/8.6/conf/etc/nginx/php.conf | 1 + .../8.6/conf/etc/nginx/ssl/server.crt | 28 + .../8.6/conf/etc/nginx/ssl/server.csr | 26 + .../8.6/conf/etc/nginx/ssl/server.key | 51 + .../8.6/conf/etc/nginx/vhost.common.conf | 2 + .../conf/etc/nginx/vhost.common.d/.gitkeep | 0 .../etc/nginx/vhost.common.d/10-general.conf | 1 + .../vhost.common.d/10-location-root.conf | 3 + .../conf/etc/nginx/vhost.common.d/10-log.conf | 2 + .../conf/etc/nginx/vhost.common.d/10-php.conf | 7 + .../php-nginx/8.6/conf/etc/nginx/vhost.conf | 30 + .../conf/etc/nginx/vhost.ipv6/listen-443.conf | 1 + .../conf/etc/nginx/vhost.ipv6/listen-80.conf | 1 + .../8.6/conf/etc/nginx/vhost.ssl.conf | 6 + .../8.6/conf/etc/supervisor.d/nginx.conf | 14 + .../8.6/conf/provision/bootstrap.d/.gitkeep | 0 .../conf/provision/bootstrap.d/10-nginx.sh | 38 + .../8.6/conf/provision/bootstrap.d/10-php.sh | 7 + .../8.6/conf/provision/entrypoint.d/.gitkeep | 0 .../conf/provision/entrypoint.d/20-nginx.sh | 30 + docker/php-official/8.2-alpine/Dockerfile | 9 +- .../provision/bootstrap.d/30-setup-ioncube.sh | 7 + docker/php-official/8.2/Dockerfile | 22 +- .../provision/bootstrap.d/30-setup-ioncube.sh | 7 + docker/php-official/8.3-alpine/Dockerfile | 9 +- .../provision/bootstrap.d/30-setup-ioncube.sh | 7 + docker/php-official/8.3/Dockerfile | 22 +- .../provision/bootstrap.d/30-setup-ioncube.sh | 7 + docker/php-official/8.4-alpine/Dockerfile | 9 +- .../provision/bootstrap.d/30-setup-ioncube.sh | 7 + docker/php-official/8.4/Dockerfile | 22 +- .../provision/bootstrap.d/30-setup-ioncube.sh | 7 + docker/php-official/8.5-alpine/Dockerfile | 9 +- .../provision/bootstrap.d/30-setup-ioncube.sh | 7 + docker/php-official/8.5/Dockerfile | 22 +- .../provision/bootstrap.d/30-setup-ioncube.sh | 7 + docker/php-official/8.6-alpine/Dockerfile | 272 +++ .../php-official/8.6-alpine/Dockerfile.twig | 45 + docker/php-official/8.6-alpine/conf/VERSION | 1 + .../8.6-alpine/conf/bin/bootstrap.sh | 3 + .../8.6-alpine/conf/bin/config.sh | 117 ++ .../8.6-alpine/conf/bin/control.sh | 78 + .../8.6-alpine/conf/bin/entrypoint.d/cli.sh | 19 + .../conf/bin/entrypoint.d/default.sh | 3 + .../8.6-alpine/conf/bin/entrypoint.d/noop.sh | 7 + .../8.6-alpine/conf/bin/entrypoint.d/root.sh | 14 + .../conf/bin/entrypoint.d/supervisord.sh | 9 + .../8.6-alpine/conf/bin/entrypoint.sh | 46 + .../conf/bin/service.d/cron.d/10-init.sh | 16 + .../8.6-alpine/conf/bin/service.d/cron.sh | 10 + .../conf/bin/service.d/dnsmasq.d/10-init.sh | 37 + .../8.6-alpine/conf/bin/service.d/dnsmasq.sh | 11 + .../conf/bin/service.d/php-fpm.d/10-init.sh | 12 + .../8.6-alpine/conf/bin/service.d/php-fpm.sh | 10 + .../conf/bin/service.d/postfix.d/10-init.sh | 30 + .../8.6-alpine/conf/bin/service.d/postfix.sh | 42 + .../conf/bin/service.d/ssh.d/10-init.sh | 7 + .../8.6-alpine/conf/bin/service.d/ssh.sh | 10 + .../bin/service.d/supervisor.d/10-init.sh | 1 + .../conf/bin/service.d/supervisor.sh | 11 + .../conf/bin/service.d/syslog-ng.d/10-init.sh | 10 + .../conf/bin/service.d/syslog-ng.sh | 10 + .../bin/usr-bin/container-file-auto-restore | 26 + .../conf/bin/usr-bin/docker-cronjob | 26 + .../conf/bin/usr-bin/docker-php-setting | 44 + .../conf/bin/usr-bin/docker-service | 89 + .../conf/bin/usr-bin/docker-service-disable | 3 + .../conf/bin/usr-bin/docker-service-enable | 4 + .../8.6-alpine/conf/bin/usr-bin/service | 86 + .../conf/bin/usr-bin/version-compare | 43 + .../8.6-alpine/conf/etc/cron/.gitkeep | 0 .../8.6-alpine/conf/etc/logrotate.d/syslog-ng | 38 + .../8.6-alpine/conf/etc/php/conf.d/.gitkeep | 0 .../8.6-alpine/conf/etc/php/fpm/.gitkeep | 0 .../8.6-alpine/conf/etc/php/php.ini | 1 + .../8.6-alpine/conf/etc/php/php.webdevops.ini | 36 + .../8.6-alpine/conf/etc/supervisor.conf | 20 + .../8.6-alpine/conf/etc/supervisor.d/.gitkeep | 0 .../conf/etc/supervisor.d/cron.conf | 14 + .../conf/etc/supervisor.d/dnsmasq.conf | 14 + .../conf/etc/supervisor.d/php-fpm.conf | 15 + .../conf/etc/supervisor.d/postfix.conf | 15 + .../8.6-alpine/conf/etc/supervisor.d/ssh.conf | 14 + .../conf/etc/supervisor.d/syslog.conf | 13 + .../conf/etc/syslog-ng/syslog-ng.conf | 48 + .../conf/provision/bootstrap.d/.gitkeep | 0 .../provision/bootstrap.d/10-entrypoint.sh | 14 + .../provision/bootstrap.d/10-permissions.sh | 2 + .../conf/provision/bootstrap.d/10-php-init.sh | 3 + .../provision/bootstrap.d/10-supervisor.sh | 10 + .../bootstrap.d/10-user-application.sh | 8 + .../conf/provision/bootstrap.d/11-php-conf.sh | 8 + .../conf/provision/bootstrap.d/20-app.sh | 5 + .../bootstrap.d/20-setup-php-fpm-pool.sh | 38 + .../provision/bootstrap.d/20-setup-php-fpm.sh | 26 + .../provision/bootstrap.d/20-setup-php.sh | 11 + .../provision/bootstrap.d/30-setup-ioncube.sh | 68 + .../conf/provision/bootstrap.d/90-cleanup.sh | 12 + .../conf/provision/build.d/.gitkeep | 0 .../conf/provision/build.d/10-cleanup.sh | 7 + .../conf/provision/entrypoint.d/.gitkeep | 0 .../provision/entrypoint.d/05-permissions.sh | 2 + .../conf/provision/entrypoint.d/20-php-fpm.sh | 80 + .../conf/provision/entrypoint.d/20-php.sh | 75 + .../conf/provision/service.d/.gitkeep | 0 .../conf/provision/service.d/cron.sh | 13 + .../conf/provision/service.d/dnsmasq.sh | 24 + .../conf/provision/service.d/postfix.sh | 32 + .../conf/provision/service.d/ssh.sh | 17 + .../conf/provision/service.d/syslog.sh | 41 + docker/php-official/8.6/Dockerfile | 260 +++ docker/php-official/8.6/Dockerfile.twig | 46 + docker/php-official/8.6/conf/VERSION | 1 + docker/php-official/8.6/conf/bin/bootstrap.sh | 3 + docker/php-official/8.6/conf/bin/config.sh | 117 ++ docker/php-official/8.6/conf/bin/control.sh | 78 + .../8.6/conf/bin/entrypoint.d/cli.sh | 19 + .../8.6/conf/bin/entrypoint.d/default.sh | 3 + .../8.6/conf/bin/entrypoint.d/noop.sh | 7 + .../8.6/conf/bin/entrypoint.d/root.sh | 14 + .../8.6/conf/bin/entrypoint.d/supervisord.sh | 9 + .../php-official/8.6/conf/bin/entrypoint.sh | 46 + .../8.6/conf/bin/service.d/cron.d/10-init.sh | 16 + .../8.6/conf/bin/service.d/cron.sh | 10 + .../conf/bin/service.d/dnsmasq.d/10-init.sh | 37 + .../8.6/conf/bin/service.d/dnsmasq.sh | 11 + .../conf/bin/service.d/php-fpm.d/10-init.sh | 12 + .../8.6/conf/bin/service.d/php-fpm.sh | 10 + .../conf/bin/service.d/postfix.d/10-init.sh | 30 + .../8.6/conf/bin/service.d/postfix.sh | 42 + .../8.6/conf/bin/service.d/ssh.d/10-init.sh | 7 + .../8.6/conf/bin/service.d/ssh.sh | 10 + .../bin/service.d/supervisor.d/10-init.sh | 1 + .../8.6/conf/bin/service.d/supervisor.sh | 11 + .../conf/bin/service.d/syslog-ng.d/10-init.sh | 10 + .../8.6/conf/bin/service.d/syslog-ng.sh | 10 + .../bin/usr-bin/container-file-auto-restore | 26 + .../8.6/conf/bin/usr-bin/docker-cronjob | 26 + .../8.6/conf/bin/usr-bin/docker-php-setting | 44 + .../8.6/conf/bin/usr-bin/docker-service | 89 + .../conf/bin/usr-bin/docker-service-disable | 3 + .../conf/bin/usr-bin/docker-service-enable | 4 + .../php-official/8.6/conf/bin/usr-bin/service | 86 + .../8.6/conf/bin/usr-bin/version-compare | 43 + .../php-official/8.6/conf/etc/cron/.gitkeep | 0 .../8.6/conf/etc/logrotate.d/syslog-ng | 38 + .../8.6/conf/etc/php/conf.d/.gitkeep | 0 .../8.6/conf/etc/php/fpm/.gitkeep | 0 docker/php-official/8.6/conf/etc/php/php.ini | 1 + .../8.6/conf/etc/php/php.webdevops.ini | 36 + .../php-official/8.6/conf/etc/supervisor.conf | 20 + .../8.6/conf/etc/supervisor.d/.gitkeep | 0 .../8.6/conf/etc/supervisor.d/cron.conf | 14 + .../8.6/conf/etc/supervisor.d/dnsmasq.conf | 14 + .../8.6/conf/etc/supervisor.d/php-fpm.conf | 15 + .../8.6/conf/etc/supervisor.d/postfix.conf | 15 + .../8.6/conf/etc/supervisor.d/ssh.conf | 14 + .../8.6/conf/etc/supervisor.d/syslog.conf | 13 + .../8.6/conf/etc/syslog-ng/syslog-ng.conf | 48 + .../8.6/conf/provision/bootstrap.d/.gitkeep | 0 .../provision/bootstrap.d/10-entrypoint.sh | 14 + .../provision/bootstrap.d/10-permissions.sh | 2 + .../conf/provision/bootstrap.d/10-php-init.sh | 3 + .../provision/bootstrap.d/10-supervisor.sh | 10 + .../bootstrap.d/10-user-application.sh | 10 + .../conf/provision/bootstrap.d/11-php-conf.sh | 8 + .../8.6/conf/provision/bootstrap.d/20-app.sh | 5 + .../bootstrap.d/20-setup-php-fpm-pool.sh | 38 + .../provision/bootstrap.d/20-setup-php-fpm.sh | 26 + .../provision/bootstrap.d/20-setup-php.sh | 11 + .../provision/bootstrap.d/30-setup-ioncube.sh | 68 + .../conf/provision/bootstrap.d/90-cleanup.sh | 12 + .../8.6/conf/provision/build.d/.gitkeep | 0 .../8.6/conf/provision/build.d/10-cleanup.sh | 7 + .../8.6/conf/provision/entrypoint.d/.gitkeep | 0 .../provision/entrypoint.d/05-permissions.sh | 2 + .../conf/provision/entrypoint.d/20-php-fpm.sh | 80 + .../8.6/conf/provision/entrypoint.d/20-php.sh | 75 + .../8.6/conf/provision/service.d/.gitkeep | 0 .../8.6/conf/provision/service.d/cron.sh | 13 + .../8.6/conf/provision/service.d/dnsmasq.sh | 24 + .../8.6/conf/provision/service.d/postfix.sh | 32 + .../8.6/conf/provision/service.d/ssh.sh | 17 + .../8.6/conf/provision/service.d/syslog.sh | 41 + docker/php/8.6 | 1 + docker/php/8.6-alpine | 1 + docs/README.md | 2 +- docs/assets/readme-banner-dark.svg | 20 +- docs/assets/readme-banner-light.svg | 20 +- docs/images/php-apache.md | 2 +- docs/images/php-nginx.md | 2 +- docs/images/php.md | 35 +- docs/known-issues.md | 16 +- .../provision/bootstrap.d/30-setup-ioncube.sh | 7 + template/Dockerfile/images/baseapp.twig | 2 +- template/Dockerfile/images/nginx.twig | 7 +- .../Dockerfile/images/php-extensions.twig | 48 +- template/Dockerfile/images/php.twig | 98 +- tests/serverspec/spec/shared/php/modules.rb | 8 +- tests/serverspec/spec/shared/php/version.rb | 11 +- tests/serverspec/spec/spec_config.rb | 3 + tests/structure-test/php/test.yaml | 7 +- 391 files changed, 8828 insertions(+), 317 deletions(-) create mode 100644 docker/php-apache-dev/8.6-alpine/Dockerfile create mode 100644 docker/php-apache-dev/8.6-alpine/Dockerfile.twig create mode 100644 docker/php-apache-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.d/10-init.sh create mode 100644 docker/php-apache-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.sh create mode 100644 docker/php-apache-dev/8.6-alpine/conf/etc/httpd/conf.d/02-dev.conf create mode 100644 docker/php-apache-dev/8.6-alpine/conf/etc/httpd/vhost.common.d/.gitkeep create mode 100644 docker/php-apache-dev/8.6-alpine/conf/etc/httpd/vhost.common.d/02-dev.conf create mode 100644 docker/php-apache-dev/8.6-alpine/conf/etc/supervisor.d/blackfire-agent.conf create mode 100644 docker/php-apache-dev/8.6-alpine/conf/provision/bootstrap.d/10-php.sh create mode 100644 docker/php-apache-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-opcache.sh create mode 100644 docker/php-apache-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-xdebug.sh create mode 100644 docker/php-apache-dev/8.6-alpine/conf/provision/entrypoint.d/10-php-debugger.sh create mode 100644 docker/php-apache-dev/8.6-alpine/conf/provision/entrypoint.d/20-apache-dev.sh create mode 100644 docker/php-apache-dev/8.6/Dockerfile create mode 100644 docker/php-apache-dev/8.6/Dockerfile.twig create mode 100644 docker/php-apache-dev/8.6/conf/bin/service.d/blackfire-agent.d/10-init.sh create mode 100644 docker/php-apache-dev/8.6/conf/bin/service.d/blackfire-agent.sh create mode 100644 docker/php-apache-dev/8.6/conf/etc/httpd/conf.d/02-dev.conf create mode 100644 docker/php-apache-dev/8.6/conf/etc/httpd/vhost.common.d/.gitkeep create mode 100644 docker/php-apache-dev/8.6/conf/etc/httpd/vhost.common.d/02-dev.conf create mode 100644 docker/php-apache-dev/8.6/conf/etc/supervisor.d/blackfire-agent.conf create mode 100644 docker/php-apache-dev/8.6/conf/provision/bootstrap.d/10-php.sh create mode 100644 docker/php-apache-dev/8.6/conf/provision/bootstrap.d/20-php-module-opcache.sh create mode 100644 docker/php-apache-dev/8.6/conf/provision/bootstrap.d/20-php-module-xdebug.sh create mode 100644 docker/php-apache-dev/8.6/conf/provision/entrypoint.d/10-php-debugger.sh create mode 100644 docker/php-apache-dev/8.6/conf/provision/entrypoint.d/20-apache-dev.sh create mode 100644 docker/php-apache/8.6-alpine/Dockerfile create mode 100644 docker/php-apache/8.6-alpine/Dockerfile.twig create mode 100644 docker/php-apache/8.6-alpine/conf/bin/service.d/httpd.d/10-init.sh create mode 100644 docker/php-apache/8.6-alpine/conf/bin/service.d/httpd.sh create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/.gitkeep create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-error-document.conf create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-log.conf create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-php.conf create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-server.conf create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/global.conf create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/main.conf create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/php.conf create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/ssl/server.crt create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/ssl/server.csr create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/ssl/server.key create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.common.conf create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.common.d/.gitkeep create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.common.d/01-boilerplate.conf create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.conf create mode 100644 docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.ssl.conf create mode 100644 docker/php-apache/8.6-alpine/conf/etc/supervisor.d/apache.conf create mode 100644 docker/php-apache/8.6-alpine/conf/provision/bootstrap.d/.gitkeep create mode 100644 docker/php-apache/8.6-alpine/conf/provision/bootstrap.d/10-apache.sh create mode 100644 docker/php-apache/8.6-alpine/conf/provision/bootstrap.d/10-php.sh create mode 100644 docker/php-apache/8.6-alpine/conf/provision/entrypoint.d/.gitkeep create mode 100644 docker/php-apache/8.6-alpine/conf/provision/entrypoint.d/20-apache.sh create mode 100644 docker/php-apache/8.6/Dockerfile create mode 100644 docker/php-apache/8.6/Dockerfile.twig create mode 100644 docker/php-apache/8.6/conf/bin/service.d/httpd.d/10-init.sh create mode 100644 docker/php-apache/8.6/conf/bin/service.d/httpd.sh create mode 100644 docker/php-apache/8.6/conf/etc/httpd/conf.d/.gitkeep create mode 100644 docker/php-apache/8.6/conf/etc/httpd/conf.d/10-error-document.conf create mode 100644 docker/php-apache/8.6/conf/etc/httpd/conf.d/10-log.conf create mode 100644 docker/php-apache/8.6/conf/etc/httpd/conf.d/10-php.conf create mode 100644 docker/php-apache/8.6/conf/etc/httpd/conf.d/10-server.conf create mode 100644 docker/php-apache/8.6/conf/etc/httpd/global.conf create mode 100644 docker/php-apache/8.6/conf/etc/httpd/main.conf create mode 100644 docker/php-apache/8.6/conf/etc/httpd/php.conf create mode 100644 docker/php-apache/8.6/conf/etc/httpd/ssl/server.crt create mode 100644 docker/php-apache/8.6/conf/etc/httpd/ssl/server.csr create mode 100644 docker/php-apache/8.6/conf/etc/httpd/ssl/server.key create mode 100644 docker/php-apache/8.6/conf/etc/httpd/vhost.common.conf create mode 100644 docker/php-apache/8.6/conf/etc/httpd/vhost.common.d/.gitkeep create mode 100644 docker/php-apache/8.6/conf/etc/httpd/vhost.common.d/01-boilerplate.conf create mode 100644 docker/php-apache/8.6/conf/etc/httpd/vhost.conf create mode 100644 docker/php-apache/8.6/conf/etc/httpd/vhost.ssl.conf create mode 100644 docker/php-apache/8.6/conf/etc/supervisor.d/apache.conf create mode 100644 docker/php-apache/8.6/conf/provision/bootstrap.d/.gitkeep create mode 100644 docker/php-apache/8.6/conf/provision/bootstrap.d/10-apache.sh create mode 100644 docker/php-apache/8.6/conf/provision/bootstrap.d/10-php.sh create mode 100644 docker/php-apache/8.6/conf/provision/entrypoint.d/.gitkeep create mode 100644 docker/php-apache/8.6/conf/provision/entrypoint.d/20-apache.sh create mode 100644 docker/php-dev/8.6-alpine/Dockerfile create mode 100644 docker/php-dev/8.6-alpine/Dockerfile.twig create mode 100644 docker/php-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.d/10-init.sh create mode 100644 docker/php-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.sh create mode 100644 docker/php-dev/8.6-alpine/conf/bin/service.d/ssh.d/99-development.sh create mode 100644 docker/php-dev/8.6-alpine/conf/etc/supervisor.d/blackfire-agent.conf create mode 100644 docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/10-php.sh create mode 100644 docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-opcache.sh create mode 100644 docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-xdebug.sh create mode 100644 docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/99-development.sh create mode 100644 docker/php-dev/8.6-alpine/conf/provision/entrypoint.d/10-php-debugger.sh create mode 100644 docker/php-dev/8.6/Dockerfile create mode 100644 docker/php-dev/8.6/Dockerfile.twig create mode 100644 docker/php-dev/8.6/conf/bin/service.d/blackfire-agent.d/10-init.sh create mode 100644 docker/php-dev/8.6/conf/bin/service.d/blackfire-agent.sh create mode 100644 docker/php-dev/8.6/conf/bin/service.d/ssh.d/99-development.sh create mode 100644 docker/php-dev/8.6/conf/etc/supervisor.d/blackfire-agent.conf create mode 100644 docker/php-dev/8.6/conf/provision/bootstrap.d/10-php.sh create mode 100644 docker/php-dev/8.6/conf/provision/bootstrap.d/20-php-module-opcache.sh create mode 100644 docker/php-dev/8.6/conf/provision/bootstrap.d/20-php-module-xdebug.sh create mode 100644 docker/php-dev/8.6/conf/provision/bootstrap.d/99-development.sh create mode 100644 docker/php-dev/8.6/conf/provision/entrypoint.d/10-php-debugger.sh create mode 100644 docker/php-nginx-dev/8.6-alpine/Dockerfile create mode 100644 docker/php-nginx-dev/8.6-alpine/Dockerfile.twig create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.d/10-init.sh create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.sh create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/conf.d/02-dev.conf create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/vhost.common.d/.gitkeep create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/vhost.common.d/02-dev.conf create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/vhost.common.d/10-log.conf create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/etc/supervisor.d/blackfire-agent.conf create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/.gitkeep create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/10-nginx.sh create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/10-php.sh create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-opcache.sh create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-xdebug.sh create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/provision/entrypoint.d/10-php-debugger.sh create mode 100644 docker/php-nginx-dev/8.6-alpine/conf/provision/entrypoint.d/20-nginx-dev.sh create mode 100644 docker/php-nginx-dev/8.6/Dockerfile create mode 100644 docker/php-nginx-dev/8.6/Dockerfile.twig create mode 100644 docker/php-nginx-dev/8.6/conf/bin/service.d/blackfire-agent.d/10-init.sh create mode 100644 docker/php-nginx-dev/8.6/conf/bin/service.d/blackfire-agent.sh create mode 100644 docker/php-nginx-dev/8.6/conf/etc/nginx/conf.d/02-dev.conf create mode 100644 docker/php-nginx-dev/8.6/conf/etc/nginx/vhost.common.d/.gitkeep create mode 100644 docker/php-nginx-dev/8.6/conf/etc/nginx/vhost.common.d/02-dev.conf create mode 100644 docker/php-nginx-dev/8.6/conf/etc/nginx/vhost.common.d/10-log.conf create mode 100644 docker/php-nginx-dev/8.6/conf/etc/supervisor.d/blackfire-agent.conf create mode 100644 docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/.gitkeep create mode 100644 docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/10-nginx.sh create mode 100644 docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/10-php.sh create mode 100644 docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/20-php-module-opcache.sh create mode 100644 docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/20-php-module-xdebug.sh create mode 100644 docker/php-nginx-dev/8.6/conf/provision/entrypoint.d/10-php-debugger.sh create mode 100644 docker/php-nginx-dev/8.6/conf/provision/entrypoint.d/20-nginx-dev.sh create mode 100644 docker/php-nginx/8.6-alpine/Dockerfile create mode 100644 docker/php-nginx/8.6-alpine/Dockerfile.twig create mode 100644 docker/php-nginx/8.6-alpine/conf/bin/service.d/nginx.d/10-init.sh create mode 100644 docker/php-nginx/8.6-alpine/conf/bin/service.d/nginx.sh create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/conf.d/.gitkeep create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/conf.d/10-php.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/global.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/main.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/nginx.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/php.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/ssl/server.crt create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/ssl/server.csr create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/ssl/server.key create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/.gitkeep create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-general.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-location-root.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-log.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-php.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.ipv6/listen-443.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.ipv6/listen-80.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.ssl.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/etc/supervisor.d/nginx.conf create mode 100644 docker/php-nginx/8.6-alpine/conf/provision/bootstrap.d/.gitkeep create mode 100644 docker/php-nginx/8.6-alpine/conf/provision/bootstrap.d/10-nginx.sh create mode 100644 docker/php-nginx/8.6-alpine/conf/provision/bootstrap.d/10-php.sh create mode 100644 docker/php-nginx/8.6-alpine/conf/provision/entrypoint.d/.gitkeep create mode 100644 docker/php-nginx/8.6-alpine/conf/provision/entrypoint.d/20-nginx.sh create mode 100644 docker/php-nginx/8.6/Dockerfile create mode 100644 docker/php-nginx/8.6/Dockerfile.twig create mode 100644 docker/php-nginx/8.6/conf/bin/service.d/nginx.d/10-init.sh create mode 100644 docker/php-nginx/8.6/conf/bin/service.d/nginx.sh create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/conf.d/.gitkeep create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/conf.d/10-php.conf create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/global.conf create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/main.conf create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/php.conf create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/ssl/server.crt create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/ssl/server.csr create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/ssl/server.key create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/vhost.common.conf create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/.gitkeep create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-general.conf create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-location-root.conf create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-log.conf create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-php.conf create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/vhost.conf create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/vhost.ipv6/listen-443.conf create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/vhost.ipv6/listen-80.conf create mode 100644 docker/php-nginx/8.6/conf/etc/nginx/vhost.ssl.conf create mode 100644 docker/php-nginx/8.6/conf/etc/supervisor.d/nginx.conf create mode 100644 docker/php-nginx/8.6/conf/provision/bootstrap.d/.gitkeep create mode 100644 docker/php-nginx/8.6/conf/provision/bootstrap.d/10-nginx.sh create mode 100644 docker/php-nginx/8.6/conf/provision/bootstrap.d/10-php.sh create mode 100644 docker/php-nginx/8.6/conf/provision/entrypoint.d/.gitkeep create mode 100644 docker/php-nginx/8.6/conf/provision/entrypoint.d/20-nginx.sh create mode 100644 docker/php-official/8.6-alpine/Dockerfile create mode 100644 docker/php-official/8.6-alpine/Dockerfile.twig create mode 100644 docker/php-official/8.6-alpine/conf/VERSION create mode 100644 docker/php-official/8.6-alpine/conf/bin/bootstrap.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/config.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/control.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/entrypoint.d/cli.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/entrypoint.d/default.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/entrypoint.d/noop.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/entrypoint.d/root.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/entrypoint.d/supervisord.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/entrypoint.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/cron.d/10-init.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/cron.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/dnsmasq.d/10-init.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/dnsmasq.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/php-fpm.d/10-init.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/php-fpm.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/postfix.d/10-init.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/postfix.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/ssh.d/10-init.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/ssh.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/supervisor.d/10-init.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/supervisor.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/syslog-ng.d/10-init.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/service.d/syslog-ng.sh create mode 100644 docker/php-official/8.6-alpine/conf/bin/usr-bin/container-file-auto-restore create mode 100644 docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-cronjob create mode 100644 docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-php-setting create mode 100644 docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-service create mode 100644 docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-service-disable create mode 100644 docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-service-enable create mode 100755 docker/php-official/8.6-alpine/conf/bin/usr-bin/service create mode 100644 docker/php-official/8.6-alpine/conf/bin/usr-bin/version-compare create mode 100644 docker/php-official/8.6-alpine/conf/etc/cron/.gitkeep create mode 100644 docker/php-official/8.6-alpine/conf/etc/logrotate.d/syslog-ng create mode 100644 docker/php-official/8.6-alpine/conf/etc/php/conf.d/.gitkeep create mode 100644 docker/php-official/8.6-alpine/conf/etc/php/fpm/.gitkeep create mode 100644 docker/php-official/8.6-alpine/conf/etc/php/php.ini create mode 100644 docker/php-official/8.6-alpine/conf/etc/php/php.webdevops.ini create mode 100644 docker/php-official/8.6-alpine/conf/etc/supervisor.conf create mode 100644 docker/php-official/8.6-alpine/conf/etc/supervisor.d/.gitkeep create mode 100644 docker/php-official/8.6-alpine/conf/etc/supervisor.d/cron.conf create mode 100644 docker/php-official/8.6-alpine/conf/etc/supervisor.d/dnsmasq.conf create mode 100644 docker/php-official/8.6-alpine/conf/etc/supervisor.d/php-fpm.conf create mode 100644 docker/php-official/8.6-alpine/conf/etc/supervisor.d/postfix.conf create mode 100644 docker/php-official/8.6-alpine/conf/etc/supervisor.d/ssh.conf create mode 100644 docker/php-official/8.6-alpine/conf/etc/supervisor.d/syslog.conf create mode 100644 docker/php-official/8.6-alpine/conf/etc/syslog-ng/syslog-ng.conf create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/.gitkeep create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-entrypoint.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-permissions.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-php-init.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-supervisor.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-user-application.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/11-php-conf.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-app.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-setup-php-fpm-pool.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-setup-php-fpm.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-setup-php.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/bootstrap.d/90-cleanup.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/build.d/.gitkeep create mode 100644 docker/php-official/8.6-alpine/conf/provision/build.d/10-cleanup.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/entrypoint.d/.gitkeep create mode 100644 docker/php-official/8.6-alpine/conf/provision/entrypoint.d/05-permissions.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/entrypoint.d/20-php-fpm.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/entrypoint.d/20-php.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/service.d/.gitkeep create mode 100644 docker/php-official/8.6-alpine/conf/provision/service.d/cron.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/service.d/dnsmasq.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/service.d/postfix.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/service.d/ssh.sh create mode 100644 docker/php-official/8.6-alpine/conf/provision/service.d/syslog.sh create mode 100644 docker/php-official/8.6/Dockerfile create mode 100644 docker/php-official/8.6/Dockerfile.twig create mode 100644 docker/php-official/8.6/conf/VERSION create mode 100644 docker/php-official/8.6/conf/bin/bootstrap.sh create mode 100644 docker/php-official/8.6/conf/bin/config.sh create mode 100644 docker/php-official/8.6/conf/bin/control.sh create mode 100644 docker/php-official/8.6/conf/bin/entrypoint.d/cli.sh create mode 100644 docker/php-official/8.6/conf/bin/entrypoint.d/default.sh create mode 100644 docker/php-official/8.6/conf/bin/entrypoint.d/noop.sh create mode 100644 docker/php-official/8.6/conf/bin/entrypoint.d/root.sh create mode 100644 docker/php-official/8.6/conf/bin/entrypoint.d/supervisord.sh create mode 100644 docker/php-official/8.6/conf/bin/entrypoint.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/cron.d/10-init.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/cron.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/dnsmasq.d/10-init.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/dnsmasq.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/php-fpm.d/10-init.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/php-fpm.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/postfix.d/10-init.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/postfix.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/ssh.d/10-init.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/ssh.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/supervisor.d/10-init.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/supervisor.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/syslog-ng.d/10-init.sh create mode 100644 docker/php-official/8.6/conf/bin/service.d/syslog-ng.sh create mode 100644 docker/php-official/8.6/conf/bin/usr-bin/container-file-auto-restore create mode 100644 docker/php-official/8.6/conf/bin/usr-bin/docker-cronjob create mode 100644 docker/php-official/8.6/conf/bin/usr-bin/docker-php-setting create mode 100644 docker/php-official/8.6/conf/bin/usr-bin/docker-service create mode 100644 docker/php-official/8.6/conf/bin/usr-bin/docker-service-disable create mode 100644 docker/php-official/8.6/conf/bin/usr-bin/docker-service-enable create mode 100755 docker/php-official/8.6/conf/bin/usr-bin/service create mode 100644 docker/php-official/8.6/conf/bin/usr-bin/version-compare create mode 100644 docker/php-official/8.6/conf/etc/cron/.gitkeep create mode 100644 docker/php-official/8.6/conf/etc/logrotate.d/syslog-ng create mode 100644 docker/php-official/8.6/conf/etc/php/conf.d/.gitkeep create mode 100644 docker/php-official/8.6/conf/etc/php/fpm/.gitkeep create mode 100644 docker/php-official/8.6/conf/etc/php/php.ini create mode 100644 docker/php-official/8.6/conf/etc/php/php.webdevops.ini create mode 100644 docker/php-official/8.6/conf/etc/supervisor.conf create mode 100644 docker/php-official/8.6/conf/etc/supervisor.d/.gitkeep create mode 100644 docker/php-official/8.6/conf/etc/supervisor.d/cron.conf create mode 100644 docker/php-official/8.6/conf/etc/supervisor.d/dnsmasq.conf create mode 100644 docker/php-official/8.6/conf/etc/supervisor.d/php-fpm.conf create mode 100644 docker/php-official/8.6/conf/etc/supervisor.d/postfix.conf create mode 100644 docker/php-official/8.6/conf/etc/supervisor.d/ssh.conf create mode 100644 docker/php-official/8.6/conf/etc/supervisor.d/syslog.conf create mode 100644 docker/php-official/8.6/conf/etc/syslog-ng/syslog-ng.conf create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/.gitkeep create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/10-entrypoint.sh create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/10-permissions.sh create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/10-php-init.sh create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/10-supervisor.sh create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/10-user-application.sh create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/11-php-conf.sh create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/20-app.sh create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/20-setup-php-fpm-pool.sh create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/20-setup-php-fpm.sh create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/20-setup-php.sh create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/30-setup-ioncube.sh create mode 100644 docker/php-official/8.6/conf/provision/bootstrap.d/90-cleanup.sh create mode 100644 docker/php-official/8.6/conf/provision/build.d/.gitkeep create mode 100644 docker/php-official/8.6/conf/provision/build.d/10-cleanup.sh create mode 100644 docker/php-official/8.6/conf/provision/entrypoint.d/.gitkeep create mode 100644 docker/php-official/8.6/conf/provision/entrypoint.d/05-permissions.sh create mode 100644 docker/php-official/8.6/conf/provision/entrypoint.d/20-php-fpm.sh create mode 100644 docker/php-official/8.6/conf/provision/entrypoint.d/20-php.sh create mode 100644 docker/php-official/8.6/conf/provision/service.d/.gitkeep create mode 100644 docker/php-official/8.6/conf/provision/service.d/cron.sh create mode 100644 docker/php-official/8.6/conf/provision/service.d/dnsmasq.sh create mode 100644 docker/php-official/8.6/conf/provision/service.d/postfix.sh create mode 100644 docker/php-official/8.6/conf/provision/service.d/ssh.sh create mode 100644 docker/php-official/8.6/conf/provision/service.d/syslog.sh create mode 120000 docker/php/8.6 create mode 120000 docker/php/8.6-alpine diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d451f9ab2..d9961e5b7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2101,6 +2101,232 @@ jobs: sleep $((i*i)) done exit 1 + php-apache-dev_8-6: + strategy: + fail-fast: false + matrix: + include: + - + arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + - + arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + name: 'webdevops/php-apache-dev:8.6 (${{ matrix.arch }})' + needs: php-apache_8-6_publish + if: '${{ !failure() && !cancelled() }}' + runs-on: '${{ matrix.runner }}' + container: webdevops/dockerfile-build-env + steps: + - + uses: actions/checkout@v7 + with: + persist-credentials: false + - + uses: docker/setup-buildx-action@v4 + - + name: 'Download parent image (OCI layout): webdevops/php-apache:8.6' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/download-artifact@v8 + with: + name: 'docker-parent-php-apache_8-6-${{ matrix.arch }}' + path: .ci-oci-image/php-apache_8-6 + - + name: 'Build (load locally)' + if: "${{ github.ref == 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-apache-dev/8.6 + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-apache-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-apache-dev:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-apache-dev:8.6-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + - + name: 'Build (load locally, from parent artifact)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-apache-dev/8.6 + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-apache-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-apache-dev:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-apache-dev:8.6-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php-apache:8.6=oci-layout://.ci-oci-image/php-apache_8-6:ci-parent-image' + - + name: 'run serverspec' + run: |- + cd tests/serverspec + echo "FROM ghcr.io/webdevops/php-apache-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6 >> Dockerfile_test + echo "COPY conf/ /" >> Dockerfile_test + bundle install + bash serverspec.sh spec/docker/php-apache-dev_spec.rb webdevops/php-apache-dev:8.6 eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1hcGFjaGUtZGV2OjguNiIsIkRPQ0tFUl9UQUciOiI4LjYiLCJPU19GQU1JTFkiOiJkZWJpYW4iLCJPU19WRVJTSU9OIjoiMTMiLCJQSFBfT0ZGSUNJQUwiOiIxIiwiRE9DS0VSRklMRSI6IkRvY2tlcmZpbGVfdGVzdCJ9 Dockerfile_test + - + if: "${{github.ref == 'refs/heads/master'}}" + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Push arch image' + if: "${{github.ref == 'refs/heads/master'}}" + run: 'docker push "ghcr.io/webdevops/php-apache-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6' + php-apache-dev_8-6-alpine: + strategy: + fail-fast: false + matrix: + include: + - + arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + - + arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + name: 'webdevops/php-apache-dev:8.6-alpine (${{ matrix.arch }})' + needs: php-apache_8-6-alpine_publish + if: '${{ !failure() && !cancelled() }}' + runs-on: '${{ matrix.runner }}' + container: webdevops/dockerfile-build-env + steps: + - + uses: actions/checkout@v7 + with: + persist-credentials: false + - + uses: docker/setup-buildx-action@v4 + - + name: 'Download parent image (OCI layout): webdevops/php-apache:8.6-alpine' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/download-artifact@v8 + with: + name: 'docker-parent-php-apache_8-6-alpine-${{ matrix.arch }}' + path: .ci-oci-image/php-apache_8-6-alpine + - + name: 'Build (load locally)' + if: "${{ github.ref == 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-apache-dev/8.6-alpine + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-apache-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-apache-dev:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-apache-dev:8.6-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + - + name: 'Build (load locally, from parent artifact)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-apache-dev/8.6-alpine + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-apache-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-apache-dev:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-apache-dev:8.6-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php-apache:8.6-alpine=oci-layout://.ci-oci-image/php-apache_8-6-alpine:ci-parent-image' + - + name: 'run serverspec' + run: |- + cd tests/serverspec + echo "FROM ghcr.io/webdevops/php-apache-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6-alpine >> Dockerfile_test + echo "COPY conf/ /" >> Dockerfile_test + bundle install + bash serverspec.sh spec/docker/php-apache-dev_spec.rb webdevops/php-apache-dev:8.6-alpine eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1hcGFjaGUtZGV2OjguNi1hbHBpbmUiLCJET0NLRVJfVEFHIjoiOC42LWFscGluZSIsIk9TX0ZBTUlMWSI6ImFscGluZSIsIk9TX1ZFUlNJT04iOiIzIiwiUEhQX09GRklDSUFMIjoiMSIsIkRPQ0tFUkZJTEUiOiJEb2NrZXJmaWxlX3Rlc3QifQ== Dockerfile_test + - + if: "${{github.ref == 'refs/heads/master'}}" + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Push arch image' + if: "${{github.ref == 'refs/heads/master'}}" + run: 'docker push "ghcr.io/webdevops/php-apache-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6-alpine' + php-apache-dev_8-6-alpine_publish: + name: 'webdevops/php-apache-dev:8.6-alpine - Publish' + runs-on: ubuntu-latest + needs: php-apache-dev_8-6-alpine + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Login to hub.docker.com' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' + - + name: 'Create and push multi-arch manifest' + run: |- + set -euo pipefail + for i in 1 2 3 4 5 6 7 8 9 10; do + docker buildx imagetools create \ + -t "webdevops/php-apache-dev:8.6-alpine" \ + -t "ghcr.io/webdevops/php-apache-dev:8.6-alpine" \ + "ghcr.io/webdevops/php-apache-dev:sha-${{ github.sha }}-amd64-8.6-alpine" \ + "ghcr.io/webdevops/php-apache-dev:sha-${{ github.sha }}-arm64-8.6-alpine" && exit 0 + sleep $((i*i)) + done + exit 1 + php-apache-dev_8-6_publish: + name: 'webdevops/php-apache-dev:8.6 - Publish' + runs-on: ubuntu-latest + needs: php-apache-dev_8-6 + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Login to hub.docker.com' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' + - + name: 'Create and push multi-arch manifest' + run: |- + set -euo pipefail + for i in 1 2 3 4 5 6 7 8 9 10; do + docker buildx imagetools create \ + -t "webdevops/php-apache-dev:8.6" \ + -t "ghcr.io/webdevops/php-apache-dev:8.6" \ + "ghcr.io/webdevops/php-apache-dev:sha-${{ github.sha }}-amd64-8.6" \ + "ghcr.io/webdevops/php-apache-dev:sha-${{ github.sha }}-arm64-8.6" && exit 0 + sleep $((i*i)) + done + exit 1 php-apache_8-2: strategy: fail-fast: false @@ -3189,7 +3415,7 @@ jobs: sleep $((i*i)) done exit 1 - php-dev_8-2: + php-apache_8-6: strategy: fail-fast: false matrix: @@ -3202,8 +3428,8 @@ jobs: arch: arm64 runner: ubuntu-24.04-arm platform: linux/arm64 - name: 'webdevops/php-dev:8.2 (${{ matrix.arch }})' - needs: php_8-2_publish + name: 'webdevops/php-apache:8.6 (${{ matrix.arch }})' + needs: php_8-6_publish if: '${{ !failure() && !cancelled() }}' runs-on: '${{ matrix.runner }}' container: webdevops/dockerfile-build-env @@ -3215,52 +3441,47 @@ jobs: - uses: docker/setup-buildx-action@v4 - - name: 'Download parent image (OCI layout): webdevops/php:8.2' + name: 'Download parent image (OCI layout): webdevops/php:8.6' if: "${{ github.ref != 'refs/heads/master' }}" uses: actions/download-artifact@v8 with: - name: 'docker-parent-php_8-2-${{ matrix.arch }}' - path: .ci-oci-image/php_8-2 + name: 'docker-parent-php_8-6-${{ matrix.arch }}' + path: .ci-oci-image/php_8-6 - name: 'Build (load locally)' if: "${{ github.ref == 'refs/heads/master' }}" uses: docker/build-push-action@v7 with: - context: docker/php-dev/8.2 + context: docker/php-apache/8.6 platforms: '${{ matrix.platform }}' load: true - tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.2' + tags: 'ghcr.io/webdevops/php-apache:sha-${{ github.sha }}-${{ matrix.arch }}-8.6' no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/php-dev:8.2-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/php-dev:8.2-${{ matrix.arch }},mode=max' + cache-from: 'type=gha,scope=webdevops/php-apache:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-apache:8.6-${{ matrix.arch }},mode=max' build-args: 'TARGETARCH=${{ matrix.arch }}' - name: 'Build (load locally, from parent artifact)' if: "${{ github.ref != 'refs/heads/master' }}" uses: docker/build-push-action@v7 with: - context: docker/php-dev/8.2 + context: docker/php-apache/8.6 platforms: '${{ matrix.platform }}' load: true - tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.2' + tags: 'ghcr.io/webdevops/php-apache:sha-${{ github.sha }}-${{ matrix.arch }}-8.6' no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/php-dev:8.2-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/php-dev:8.2-${{ matrix.arch }},mode=max' + cache-from: 'type=gha,scope=webdevops/php-apache:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-apache:8.6-${{ matrix.arch }},mode=max' build-args: 'TARGETARCH=${{ matrix.arch }}' - build-contexts: 'webdevops/php:8.2=oci-layout://.ci-oci-image/php_8-2:ci-parent-image' + build-contexts: 'webdevops/php:8.6=oci-layout://.ci-oci-image/php_8-6:ci-parent-image' - name: 'run serverspec' run: |- cd tests/serverspec - echo "FROM ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.2 >> Dockerfile_test + echo "FROM ghcr.io/webdevops/php-apache:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6 >> Dockerfile_test echo "COPY conf/ /" >> Dockerfile_test bundle install - bash serverspec.sh spec/docker/php-dev_spec.rb webdevops/php-dev:8.2 eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1kZXY6OC4yIiwiRE9DS0VSX1RBRyI6IjguMiIsIk9TX0ZBTUlMWSI6ImRlYmlhbiIsIk9TX1ZFUlNJT04iOiIxMiIsIlBIUF9PRkZJQ0lBTCI6IjEiLCJET0NLRVJGSUxFIjoiRG9ja2VyZmlsZV90ZXN0In0= Dockerfile_test - - - name: 'run structure-test' - run: |- - cd tests/structure-test - /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.2 --config php-dev/test.yaml + bash serverspec.sh spec/docker/php-apache_spec.rb webdevops/php-apache:8.6 eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1hcGFjaGU6OC42IiwiRE9DS0VSX1RBRyI6IjguNiIsIk9TX0ZBTUlMWSI6ImRlYmlhbiIsIk9TX1ZFUlNJT04iOiIxMyIsIlBIUF9PRkZJQ0lBTCI6IjEiLCJET0NLRVJGSUxFIjoiRG9ja2VyZmlsZV90ZXN0In0= Dockerfile_test - if: "${{github.ref == 'refs/heads/master'}}" name: 'Login to ghcr.io' @@ -3272,8 +3493,31 @@ jobs: - name: 'Push arch image' if: "${{github.ref == 'refs/heads/master'}}" - run: 'docker push "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.2' - php-dev_8-2-alpine: + run: 'docker push "ghcr.io/webdevops/php-apache:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6' + - + name: 'Export image (OCI layout)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-apache/8.6 + platforms: '${{ matrix.platform }}' + cache-from: 'type=gha,scope=webdevops/php-apache:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-apache:8.6-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php:8.6=oci-layout://.ci-oci-image/php_8-6:ci-parent-image' + outputs: 'type=oci,tar=false,name=ci-parent-image,dest=.ci-oci-image/php-apache_8-6' + - + name: 'Upload image (OCI layout)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/upload-artifact@v7 + with: + name: 'docker-parent-php-apache_8-6-${{ matrix.arch }}' + path: .ci-oci-image/php-apache_8-6 + retention-days: 1 + overwrite: true + compression-level: 0 + if-no-files-found: error + php-apache_8-6-alpine: strategy: fail-fast: false matrix: @@ -3286,8 +3530,8 @@ jobs: arch: arm64 runner: ubuntu-24.04-arm platform: linux/arm64 - name: 'webdevops/php-dev:8.2-alpine (${{ matrix.arch }})' - needs: php_8-2-alpine_publish + name: 'webdevops/php-apache:8.6-alpine (${{ matrix.arch }})' + needs: php_8-6-alpine_publish if: '${{ !failure() && !cancelled() }}' runs-on: '${{ matrix.runner }}' container: webdevops/dockerfile-build-env @@ -3299,52 +3543,47 @@ jobs: - uses: docker/setup-buildx-action@v4 - - name: 'Download parent image (OCI layout): webdevops/php:8.2-alpine' + name: 'Download parent image (OCI layout): webdevops/php:8.6-alpine' if: "${{ github.ref != 'refs/heads/master' }}" uses: actions/download-artifact@v8 with: - name: 'docker-parent-php_8-2-alpine-${{ matrix.arch }}' - path: .ci-oci-image/php_8-2-alpine + name: 'docker-parent-php_8-6-alpine-${{ matrix.arch }}' + path: .ci-oci-image/php_8-6-alpine - name: 'Build (load locally)' if: "${{ github.ref == 'refs/heads/master' }}" uses: docker/build-push-action@v7 with: - context: docker/php-dev/8.2-alpine + context: docker/php-apache/8.6-alpine platforms: '${{ matrix.platform }}' load: true - tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.2-alpine' + tags: 'ghcr.io/webdevops/php-apache:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine' no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/php-dev:8.2-alpine-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/php-dev:8.2-alpine-${{ matrix.arch }},mode=max' + cache-from: 'type=gha,scope=webdevops/php-apache:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-apache:8.6-alpine-${{ matrix.arch }},mode=max' build-args: 'TARGETARCH=${{ matrix.arch }}' - name: 'Build (load locally, from parent artifact)' if: "${{ github.ref != 'refs/heads/master' }}" uses: docker/build-push-action@v7 with: - context: docker/php-dev/8.2-alpine + context: docker/php-apache/8.6-alpine platforms: '${{ matrix.platform }}' load: true - tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.2-alpine' + tags: 'ghcr.io/webdevops/php-apache:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine' no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/php-dev:8.2-alpine-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/php-dev:8.2-alpine-${{ matrix.arch }},mode=max' + cache-from: 'type=gha,scope=webdevops/php-apache:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-apache:8.6-alpine-${{ matrix.arch }},mode=max' build-args: 'TARGETARCH=${{ matrix.arch }}' - build-contexts: 'webdevops/php:8.2-alpine=oci-layout://.ci-oci-image/php_8-2-alpine:ci-parent-image' + build-contexts: 'webdevops/php:8.6-alpine=oci-layout://.ci-oci-image/php_8-6-alpine:ci-parent-image' - name: 'run serverspec' run: |- cd tests/serverspec - echo "FROM ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.2-alpine >> Dockerfile_test + echo "FROM ghcr.io/webdevops/php-apache:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6-alpine >> Dockerfile_test echo "COPY conf/ /" >> Dockerfile_test bundle install - bash serverspec.sh spec/docker/php-dev_spec.rb webdevops/php-dev:8.2-alpine eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1kZXY6OC4yLWFscGluZSIsIkRPQ0tFUl9UQUciOiI4LjItYWxwaW5lIiwiT1NfRkFNSUxZIjoiYWxwaW5lIiwiT1NfVkVSU0lPTiI6IjMiLCJQSFBfT0ZGSUNJQUwiOiIxIiwiRE9DS0VSRklMRSI6IkRvY2tlcmZpbGVfdGVzdCJ9 Dockerfile_test - - - name: 'run structure-test' - run: |- - cd tests/structure-test - /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.2-alpine --config php-dev/test.yaml + bash serverspec.sh spec/docker/php-apache_spec.rb webdevops/php-apache:8.6-alpine eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1hcGFjaGU6OC42LWFscGluZSIsIkRPQ0tFUl9UQUciOiI4LjYtYWxwaW5lIiwiT1NfRkFNSUxZIjoiYWxwaW5lIiwiT1NfVkVSU0lPTiI6IjMiLCJQSFBfT0ZGSUNJQUwiOiIxIiwiRE9DS0VSRklMRSI6IkRvY2tlcmZpbGVfdGVzdCJ9 Dockerfile_test - if: "${{github.ref == 'refs/heads/master'}}" name: 'Login to ghcr.io' @@ -3356,22 +3595,281 @@ jobs: - name: 'Push arch image' if: "${{github.ref == 'refs/heads/master'}}" - run: 'docker push "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.2-alpine' - php-dev_8-2-alpine_publish: - name: 'webdevops/php-dev:8.2-alpine - Publish' - runs-on: ubuntu-latest - needs: php-dev_8-2-alpine - if: "${{github.ref == 'refs/heads/master'}}" - steps: + run: 'docker push "ghcr.io/webdevops/php-apache:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6-alpine' - - uses: docker/setup-buildx-action@v4 - - - name: 'Login to ghcr.io' - uses: docker/login-action@v4 + name: 'Export image (OCI layout)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 with: - registry: ghcr.io - username: '${{ github.actor }}' - password: '${{ secrets.GITHUB_TOKEN }}' + context: docker/php-apache/8.6-alpine + platforms: '${{ matrix.platform }}' + cache-from: 'type=gha,scope=webdevops/php-apache:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-apache:8.6-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php:8.6-alpine=oci-layout://.ci-oci-image/php_8-6-alpine:ci-parent-image' + outputs: 'type=oci,tar=false,name=ci-parent-image,dest=.ci-oci-image/php-apache_8-6-alpine' + - + name: 'Upload image (OCI layout)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/upload-artifact@v7 + with: + name: 'docker-parent-php-apache_8-6-alpine-${{ matrix.arch }}' + path: .ci-oci-image/php-apache_8-6-alpine + retention-days: 1 + overwrite: true + compression-level: 0 + if-no-files-found: error + php-apache_8-6-alpine_publish: + name: 'webdevops/php-apache:8.6-alpine - Publish' + runs-on: ubuntu-latest + needs: php-apache_8-6-alpine + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Login to hub.docker.com' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' + - + name: 'Create and push multi-arch manifest' + run: |- + set -euo pipefail + for i in 1 2 3 4 5 6 7 8 9 10; do + docker buildx imagetools create \ + -t "webdevops/php-apache:8.6-alpine" \ + -t "ghcr.io/webdevops/php-apache:8.6-alpine" \ + "ghcr.io/webdevops/php-apache:sha-${{ github.sha }}-amd64-8.6-alpine" \ + "ghcr.io/webdevops/php-apache:sha-${{ github.sha }}-arm64-8.6-alpine" && exit 0 + sleep $((i*i)) + done + exit 1 + php-apache_8-6_publish: + name: 'webdevops/php-apache:8.6 - Publish' + runs-on: ubuntu-latest + needs: php-apache_8-6 + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Login to hub.docker.com' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' + - + name: 'Create and push multi-arch manifest' + run: |- + set -euo pipefail + for i in 1 2 3 4 5 6 7 8 9 10; do + docker buildx imagetools create \ + -t "webdevops/php-apache:8.6" \ + -t "ghcr.io/webdevops/php-apache:8.6" \ + "ghcr.io/webdevops/php-apache:sha-${{ github.sha }}-amd64-8.6" \ + "ghcr.io/webdevops/php-apache:sha-${{ github.sha }}-arm64-8.6" && exit 0 + sleep $((i*i)) + done + exit 1 + php-dev_8-2: + strategy: + fail-fast: false + matrix: + include: + - + arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + - + arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + name: 'webdevops/php-dev:8.2 (${{ matrix.arch }})' + needs: php_8-2_publish + if: '${{ !failure() && !cancelled() }}' + runs-on: '${{ matrix.runner }}' + container: webdevops/dockerfile-build-env + steps: + - + uses: actions/checkout@v7 + with: + persist-credentials: false + - + uses: docker/setup-buildx-action@v4 + - + name: 'Download parent image (OCI layout): webdevops/php:8.2' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/download-artifact@v8 + with: + name: 'docker-parent-php_8-2-${{ matrix.arch }}' + path: .ci-oci-image/php_8-2 + - + name: 'Build (load locally)' + if: "${{ github.ref == 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-dev/8.2 + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.2' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-dev:8.2-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-dev:8.2-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + - + name: 'Build (load locally, from parent artifact)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-dev/8.2 + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.2' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-dev:8.2-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-dev:8.2-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php:8.2=oci-layout://.ci-oci-image/php_8-2:ci-parent-image' + - + name: 'run serverspec' + run: |- + cd tests/serverspec + echo "FROM ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.2 >> Dockerfile_test + echo "COPY conf/ /" >> Dockerfile_test + bundle install + bash serverspec.sh spec/docker/php-dev_spec.rb webdevops/php-dev:8.2 eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1kZXY6OC4yIiwiRE9DS0VSX1RBRyI6IjguMiIsIk9TX0ZBTUlMWSI6ImRlYmlhbiIsIk9TX1ZFUlNJT04iOiIxMiIsIlBIUF9PRkZJQ0lBTCI6IjEiLCJET0NLRVJGSUxFIjoiRG9ja2VyZmlsZV90ZXN0In0= Dockerfile_test + - + name: 'run structure-test' + run: |- + cd tests/structure-test + /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.2 --config php-dev/test.yaml + - + if: "${{github.ref == 'refs/heads/master'}}" + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Push arch image' + if: "${{github.ref == 'refs/heads/master'}}" + run: 'docker push "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.2' + php-dev_8-2-alpine: + strategy: + fail-fast: false + matrix: + include: + - + arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + - + arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + name: 'webdevops/php-dev:8.2-alpine (${{ matrix.arch }})' + needs: php_8-2-alpine_publish + if: '${{ !failure() && !cancelled() }}' + runs-on: '${{ matrix.runner }}' + container: webdevops/dockerfile-build-env + steps: + - + uses: actions/checkout@v7 + with: + persist-credentials: false + - + uses: docker/setup-buildx-action@v4 + - + name: 'Download parent image (OCI layout): webdevops/php:8.2-alpine' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/download-artifact@v8 + with: + name: 'docker-parent-php_8-2-alpine-${{ matrix.arch }}' + path: .ci-oci-image/php_8-2-alpine + - + name: 'Build (load locally)' + if: "${{ github.ref == 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-dev/8.2-alpine + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.2-alpine' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-dev:8.2-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-dev:8.2-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + - + name: 'Build (load locally, from parent artifact)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-dev/8.2-alpine + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.2-alpine' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-dev:8.2-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-dev:8.2-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php:8.2-alpine=oci-layout://.ci-oci-image/php_8-2-alpine:ci-parent-image' + - + name: 'run serverspec' + run: |- + cd tests/serverspec + echo "FROM ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.2-alpine >> Dockerfile_test + echo "COPY conf/ /" >> Dockerfile_test + bundle install + bash serverspec.sh spec/docker/php-dev_spec.rb webdevops/php-dev:8.2-alpine eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1kZXY6OC4yLWFscGluZSIsIkRPQ0tFUl9UQUciOiI4LjItYWxwaW5lIiwiT1NfRkFNSUxZIjoiYWxwaW5lIiwiT1NfVkVSU0lPTiI6IjMiLCJQSFBfT0ZGSUNJQUwiOiIxIiwiRE9DS0VSRklMRSI6IkRvY2tlcmZpbGVfdGVzdCJ9 Dockerfile_test + - + name: 'run structure-test' + run: |- + cd tests/structure-test + /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.2-alpine --config php-dev/test.yaml + - + if: "${{github.ref == 'refs/heads/master'}}" + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Push arch image' + if: "${{github.ref == 'refs/heads/master'}}" + run: 'docker push "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.2-alpine' + php-dev_8-2-alpine_publish: + name: 'webdevops/php-dev:8.2-alpine - Publish' + runs-on: ubuntu-latest + needs: php-dev_8-2-alpine + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' - name: 'Login to hub.docker.com' uses: docker/login-action@v4 @@ -3863,10 +4361,246 @@ jobs: sleep $((i*i)) done exit 1 - php-dev_8-4_publish: - name: 'webdevops/php-dev:8.4 - Publish' + php-dev_8-4_publish: + name: 'webdevops/php-dev:8.4 - Publish' + runs-on: ubuntu-latest + needs: php-dev_8-4 + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Login to hub.docker.com' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' + - + name: 'Create and push multi-arch manifest' + run: |- + set -euo pipefail + for i in 1 2 3 4 5 6 7 8 9 10; do + docker buildx imagetools create \ + -t "webdevops/php-dev:8.4" \ + -t "ghcr.io/webdevops/php-dev:8.4" \ + "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-amd64-8.4" \ + "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-arm64-8.4" && exit 0 + sleep $((i*i)) + done + exit 1 + php-dev_8-5: + strategy: + fail-fast: false + matrix: + include: + - + arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + - + arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + name: 'webdevops/php-dev:8.5 (${{ matrix.arch }})' + needs: php_8-5_publish + if: '${{ !failure() && !cancelled() }}' + runs-on: '${{ matrix.runner }}' + container: webdevops/dockerfile-build-env + steps: + - + uses: actions/checkout@v7 + with: + persist-credentials: false + - + uses: docker/setup-buildx-action@v4 + - + name: 'Download parent image (OCI layout): webdevops/php:8.5' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/download-artifact@v8 + with: + name: 'docker-parent-php_8-5-${{ matrix.arch }}' + path: .ci-oci-image/php_8-5 + - + name: 'Build (load locally)' + if: "${{ github.ref == 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-dev/8.5 + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.5' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-dev:8.5-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-dev:8.5-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + - + name: 'Build (load locally, from parent artifact)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-dev/8.5 + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.5' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-dev:8.5-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-dev:8.5-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php:8.5=oci-layout://.ci-oci-image/php_8-5:ci-parent-image' + - + name: 'run serverspec' + run: |- + cd tests/serverspec + echo "FROM ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.5 >> Dockerfile_test + echo "COPY conf/ /" >> Dockerfile_test + bundle install + bash serverspec.sh spec/docker/php-dev_spec.rb webdevops/php-dev:8.5 eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1kZXY6OC41IiwiRE9DS0VSX1RBRyI6IjguNSIsIk9TX0ZBTUlMWSI6ImRlYmlhbiIsIk9TX1ZFUlNJT04iOiIxMiIsIlBIUF9PRkZJQ0lBTCI6IjEiLCJET0NLRVJGSUxFIjoiRG9ja2VyZmlsZV90ZXN0In0= Dockerfile_test + - + name: 'run structure-test' + run: |- + cd tests/structure-test + /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.5 --config php-dev/test.yaml + - + if: "${{github.ref == 'refs/heads/master'}}" + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Push arch image' + if: "${{github.ref == 'refs/heads/master'}}" + run: 'docker push "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.5' + php-dev_8-5-alpine: + strategy: + fail-fast: false + matrix: + include: + - + arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + - + arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + name: 'webdevops/php-dev:8.5-alpine (${{ matrix.arch }})' + needs: php_8-5-alpine_publish + if: '${{ !failure() && !cancelled() }}' + runs-on: '${{ matrix.runner }}' + container: webdevops/dockerfile-build-env + steps: + - + uses: actions/checkout@v7 + with: + persist-credentials: false + - + uses: docker/setup-buildx-action@v4 + - + name: 'Download parent image (OCI layout): webdevops/php:8.5-alpine' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/download-artifact@v8 + with: + name: 'docker-parent-php_8-5-alpine-${{ matrix.arch }}' + path: .ci-oci-image/php_8-5-alpine + - + name: 'Build (load locally)' + if: "${{ github.ref == 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-dev/8.5-alpine + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.5-alpine' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-dev:8.5-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-dev:8.5-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + - + name: 'Build (load locally, from parent artifact)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-dev/8.5-alpine + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.5-alpine' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-dev:8.5-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-dev:8.5-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php:8.5-alpine=oci-layout://.ci-oci-image/php_8-5-alpine:ci-parent-image' + - + name: 'run serverspec' + run: |- + cd tests/serverspec + echo "FROM ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.5-alpine >> Dockerfile_test + echo "COPY conf/ /" >> Dockerfile_test + bundle install + bash serverspec.sh spec/docker/php-dev_spec.rb webdevops/php-dev:8.5-alpine eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1kZXY6OC41LWFscGluZSIsIkRPQ0tFUl9UQUciOiI4LjUtYWxwaW5lIiwiT1NfRkFNSUxZIjoiYWxwaW5lIiwiT1NfVkVSU0lPTiI6IjMiLCJQSFBfT0ZGSUNJQUwiOiIxIiwiRE9DS0VSRklMRSI6IkRvY2tlcmZpbGVfdGVzdCJ9 Dockerfile_test + - + name: 'run structure-test' + run: |- + cd tests/structure-test + /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.5-alpine --config php-dev/test.yaml + - + if: "${{github.ref == 'refs/heads/master'}}" + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Push arch image' + if: "${{github.ref == 'refs/heads/master'}}" + run: 'docker push "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.5-alpine' + php-dev_8-5-alpine_publish: + name: 'webdevops/php-dev:8.5-alpine - Publish' + runs-on: ubuntu-latest + needs: php-dev_8-5-alpine + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Login to hub.docker.com' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' + - + name: 'Create and push multi-arch manifest' + run: |- + set -euo pipefail + for i in 1 2 3 4 5 6 7 8 9 10; do + docker buildx imagetools create \ + -t "webdevops/php-dev:8.5-alpine" \ + -t "ghcr.io/webdevops/php-dev:8.5-alpine" \ + "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-amd64-8.5-alpine" \ + "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-arm64-8.5-alpine" && exit 0 + sleep $((i*i)) + done + exit 1 + php-dev_8-5_publish: + name: 'webdevops/php-dev:8.5 - Publish' runs-on: ubuntu-latest - needs: php-dev_8-4 + needs: php-dev_8-5 if: "${{github.ref == 'refs/heads/master'}}" steps: - @@ -3890,14 +4624,14 @@ jobs: set -euo pipefail for i in 1 2 3 4 5 6 7 8 9 10; do docker buildx imagetools create \ - -t "webdevops/php-dev:8.4" \ - -t "ghcr.io/webdevops/php-dev:8.4" \ - "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-amd64-8.4" \ - "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-arm64-8.4" && exit 0 + -t "webdevops/php-dev:8.5" \ + -t "ghcr.io/webdevops/php-dev:8.5" \ + "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-amd64-8.5" \ + "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-arm64-8.5" && exit 0 sleep $((i*i)) done exit 1 - php-dev_8-5: + php-dev_8-6: strategy: fail-fast: false matrix: @@ -3910,8 +4644,8 @@ jobs: arch: arm64 runner: ubuntu-24.04-arm platform: linux/arm64 - name: 'webdevops/php-dev:8.5 (${{ matrix.arch }})' - needs: php_8-5_publish + name: 'webdevops/php-dev:8.6 (${{ matrix.arch }})' + needs: php_8-6_publish if: '${{ !failure() && !cancelled() }}' runs-on: '${{ matrix.runner }}' container: webdevops/dockerfile-build-env @@ -3923,52 +4657,52 @@ jobs: - uses: docker/setup-buildx-action@v4 - - name: 'Download parent image (OCI layout): webdevops/php:8.5' + name: 'Download parent image (OCI layout): webdevops/php:8.6' if: "${{ github.ref != 'refs/heads/master' }}" uses: actions/download-artifact@v8 with: - name: 'docker-parent-php_8-5-${{ matrix.arch }}' - path: .ci-oci-image/php_8-5 + name: 'docker-parent-php_8-6-${{ matrix.arch }}' + path: .ci-oci-image/php_8-6 - name: 'Build (load locally)' if: "${{ github.ref == 'refs/heads/master' }}" uses: docker/build-push-action@v7 with: - context: docker/php-dev/8.5 + context: docker/php-dev/8.6 platforms: '${{ matrix.platform }}' load: true - tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.5' + tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6' no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/php-dev:8.5-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/php-dev:8.5-${{ matrix.arch }},mode=max' + cache-from: 'type=gha,scope=webdevops/php-dev:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-dev:8.6-${{ matrix.arch }},mode=max' build-args: 'TARGETARCH=${{ matrix.arch }}' - name: 'Build (load locally, from parent artifact)' if: "${{ github.ref != 'refs/heads/master' }}" uses: docker/build-push-action@v7 with: - context: docker/php-dev/8.5 + context: docker/php-dev/8.6 platforms: '${{ matrix.platform }}' load: true - tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.5' + tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6' no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/php-dev:8.5-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/php-dev:8.5-${{ matrix.arch }},mode=max' + cache-from: 'type=gha,scope=webdevops/php-dev:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-dev:8.6-${{ matrix.arch }},mode=max' build-args: 'TARGETARCH=${{ matrix.arch }}' - build-contexts: 'webdevops/php:8.5=oci-layout://.ci-oci-image/php_8-5:ci-parent-image' + build-contexts: 'webdevops/php:8.6=oci-layout://.ci-oci-image/php_8-6:ci-parent-image' - name: 'run serverspec' run: |- cd tests/serverspec - echo "FROM ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.5 >> Dockerfile_test + echo "FROM ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6 >> Dockerfile_test echo "COPY conf/ /" >> Dockerfile_test bundle install - bash serverspec.sh spec/docker/php-dev_spec.rb webdevops/php-dev:8.5 eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1kZXY6OC41IiwiRE9DS0VSX1RBRyI6IjguNSIsIk9TX0ZBTUlMWSI6ImRlYmlhbiIsIk9TX1ZFUlNJT04iOiIxMiIsIlBIUF9PRkZJQ0lBTCI6IjEiLCJET0NLRVJGSUxFIjoiRG9ja2VyZmlsZV90ZXN0In0= Dockerfile_test + bash serverspec.sh spec/docker/php-dev_spec.rb webdevops/php-dev:8.6 eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1kZXY6OC42IiwiRE9DS0VSX1RBRyI6IjguNiIsIk9TX0ZBTUlMWSI6ImRlYmlhbiIsIk9TX1ZFUlNJT04iOiIxMyIsIlBIUF9PRkZJQ0lBTCI6IjEiLCJET0NLRVJGSUxFIjoiRG9ja2VyZmlsZV90ZXN0In0= Dockerfile_test - name: 'run structure-test' run: |- cd tests/structure-test - /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.5 --config php-dev/test.yaml + /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6 --config php-dev/test.yaml - if: "${{github.ref == 'refs/heads/master'}}" name: 'Login to ghcr.io' @@ -3980,8 +4714,8 @@ jobs: - name: 'Push arch image' if: "${{github.ref == 'refs/heads/master'}}" - run: 'docker push "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.5' - php-dev_8-5-alpine: + run: 'docker push "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6' + php-dev_8-6-alpine: strategy: fail-fast: false matrix: @@ -3994,8 +4728,8 @@ jobs: arch: arm64 runner: ubuntu-24.04-arm platform: linux/arm64 - name: 'webdevops/php-dev:8.5-alpine (${{ matrix.arch }})' - needs: php_8-5-alpine_publish + name: 'webdevops/php-dev:8.6-alpine (${{ matrix.arch }})' + needs: php_8-6-alpine_publish if: '${{ !failure() && !cancelled() }}' runs-on: '${{ matrix.runner }}' container: webdevops/dockerfile-build-env @@ -4007,52 +4741,52 @@ jobs: - uses: docker/setup-buildx-action@v4 - - name: 'Download parent image (OCI layout): webdevops/php:8.5-alpine' + name: 'Download parent image (OCI layout): webdevops/php:8.6-alpine' if: "${{ github.ref != 'refs/heads/master' }}" uses: actions/download-artifact@v8 with: - name: 'docker-parent-php_8-5-alpine-${{ matrix.arch }}' - path: .ci-oci-image/php_8-5-alpine + name: 'docker-parent-php_8-6-alpine-${{ matrix.arch }}' + path: .ci-oci-image/php_8-6-alpine - name: 'Build (load locally)' if: "${{ github.ref == 'refs/heads/master' }}" uses: docker/build-push-action@v7 with: - context: docker/php-dev/8.5-alpine + context: docker/php-dev/8.6-alpine platforms: '${{ matrix.platform }}' load: true - tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.5-alpine' + tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine' no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/php-dev:8.5-alpine-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/php-dev:8.5-alpine-${{ matrix.arch }},mode=max' + cache-from: 'type=gha,scope=webdevops/php-dev:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-dev:8.6-alpine-${{ matrix.arch }},mode=max' build-args: 'TARGETARCH=${{ matrix.arch }}' - name: 'Build (load locally, from parent artifact)' if: "${{ github.ref != 'refs/heads/master' }}" uses: docker/build-push-action@v7 with: - context: docker/php-dev/8.5-alpine + context: docker/php-dev/8.6-alpine platforms: '${{ matrix.platform }}' load: true - tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.5-alpine' + tags: 'ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine' no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/php-dev:8.5-alpine-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/php-dev:8.5-alpine-${{ matrix.arch }},mode=max' + cache-from: 'type=gha,scope=webdevops/php-dev:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-dev:8.6-alpine-${{ matrix.arch }},mode=max' build-args: 'TARGETARCH=${{ matrix.arch }}' - build-contexts: 'webdevops/php:8.5-alpine=oci-layout://.ci-oci-image/php_8-5-alpine:ci-parent-image' + build-contexts: 'webdevops/php:8.6-alpine=oci-layout://.ci-oci-image/php_8-6-alpine:ci-parent-image' - name: 'run serverspec' run: |- cd tests/serverspec - echo "FROM ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.5-alpine >> Dockerfile_test + echo "FROM ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6-alpine >> Dockerfile_test echo "COPY conf/ /" >> Dockerfile_test bundle install - bash serverspec.sh spec/docker/php-dev_spec.rb webdevops/php-dev:8.5-alpine eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1kZXY6OC41LWFscGluZSIsIkRPQ0tFUl9UQUciOiI4LjUtYWxwaW5lIiwiT1NfRkFNSUxZIjoiYWxwaW5lIiwiT1NfVkVSU0lPTiI6IjMiLCJQSFBfT0ZGSUNJQUwiOiIxIiwiRE9DS0VSRklMRSI6IkRvY2tlcmZpbGVfdGVzdCJ9 Dockerfile_test + bash serverspec.sh spec/docker/php-dev_spec.rb webdevops/php-dev:8.6-alpine eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1kZXY6OC42LWFscGluZSIsIkRPQ0tFUl9UQUciOiI4LjYtYWxwaW5lIiwiT1NfRkFNSUxZIjoiYWxwaW5lIiwiT1NfVkVSU0lPTiI6IjMiLCJQSFBfT0ZGSUNJQUwiOiIxIiwiRE9DS0VSRklMRSI6IkRvY2tlcmZpbGVfdGVzdCJ9 Dockerfile_test - name: 'run structure-test' run: |- cd tests/structure-test - /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.5-alpine --config php-dev/test.yaml + /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine --config php-dev/test.yaml - if: "${{github.ref == 'refs/heads/master'}}" name: 'Login to ghcr.io' @@ -4064,11 +4798,11 @@ jobs: - name: 'Push arch image' if: "${{github.ref == 'refs/heads/master'}}" - run: 'docker push "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.5-alpine' - php-dev_8-5-alpine_publish: - name: 'webdevops/php-dev:8.5-alpine - Publish' + run: 'docker push "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6-alpine' + php-dev_8-6-alpine_publish: + name: 'webdevops/php-dev:8.6-alpine - Publish' runs-on: ubuntu-latest - needs: php-dev_8-5-alpine + needs: php-dev_8-6-alpine if: "${{github.ref == 'refs/heads/master'}}" steps: - @@ -4092,17 +4826,17 @@ jobs: set -euo pipefail for i in 1 2 3 4 5 6 7 8 9 10; do docker buildx imagetools create \ - -t "webdevops/php-dev:8.5-alpine" \ - -t "ghcr.io/webdevops/php-dev:8.5-alpine" \ - "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-amd64-8.5-alpine" \ - "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-arm64-8.5-alpine" && exit 0 + -t "webdevops/php-dev:8.6-alpine" \ + -t "ghcr.io/webdevops/php-dev:8.6-alpine" \ + "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-amd64-8.6-alpine" \ + "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-arm64-8.6-alpine" && exit 0 sleep $((i*i)) done exit 1 - php-dev_8-5_publish: - name: 'webdevops/php-dev:8.5 - Publish' + php-dev_8-6_publish: + name: 'webdevops/php-dev:8.6 - Publish' runs-on: ubuntu-latest - needs: php-dev_8-5 + needs: php-dev_8-6 if: "${{github.ref == 'refs/heads/master'}}" steps: - @@ -4126,10 +4860,10 @@ jobs: set -euo pipefail for i in 1 2 3 4 5 6 7 8 9 10; do docker buildx imagetools create \ - -t "webdevops/php-dev:8.5" \ - -t "ghcr.io/webdevops/php-dev:8.5" \ - "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-amd64-8.5" \ - "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-arm64-8.5" && exit 0 + -t "webdevops/php-dev:8.6" \ + -t "ghcr.io/webdevops/php-dev:8.6" \ + "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-amd64-8.6" \ + "ghcr.io/webdevops/php-dev:sha-${{ github.sha }}-arm64-8.6" && exit 0 sleep $((i*i)) done exit 1 @@ -4972,7 +5706,233 @@ jobs: php-nginx-dev_8-5-alpine_publish: name: 'webdevops/php-nginx-dev:8.5-alpine - Publish' runs-on: ubuntu-latest - needs: php-nginx-dev_8-5-alpine + needs: php-nginx-dev_8-5-alpine + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Login to hub.docker.com' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' + - + name: 'Create and push multi-arch manifest' + run: |- + set -euo pipefail + for i in 1 2 3 4 5 6 7 8 9 10; do + docker buildx imagetools create \ + -t "webdevops/php-nginx-dev:8.5-alpine" \ + -t "ghcr.io/webdevops/php-nginx-dev:8.5-alpine" \ + "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-amd64-8.5-alpine" \ + "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-arm64-8.5-alpine" && exit 0 + sleep $((i*i)) + done + exit 1 + php-nginx-dev_8-5_publish: + name: 'webdevops/php-nginx-dev:8.5 - Publish' + runs-on: ubuntu-latest + needs: php-nginx-dev_8-5 + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Login to hub.docker.com' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' + - + name: 'Create and push multi-arch manifest' + run: |- + set -euo pipefail + for i in 1 2 3 4 5 6 7 8 9 10; do + docker buildx imagetools create \ + -t "webdevops/php-nginx-dev:8.5" \ + -t "ghcr.io/webdevops/php-nginx-dev:8.5" \ + "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-amd64-8.5" \ + "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-arm64-8.5" && exit 0 + sleep $((i*i)) + done + exit 1 + php-nginx-dev_8-6: + strategy: + fail-fast: false + matrix: + include: + - + arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + - + arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + name: 'webdevops/php-nginx-dev:8.6 (${{ matrix.arch }})' + needs: php-nginx_8-6_publish + if: '${{ !failure() && !cancelled() }}' + runs-on: '${{ matrix.runner }}' + container: webdevops/dockerfile-build-env + steps: + - + uses: actions/checkout@v7 + with: + persist-credentials: false + - + uses: docker/setup-buildx-action@v4 + - + name: 'Download parent image (OCI layout): webdevops/php-nginx:8.6' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/download-artifact@v8 + with: + name: 'docker-parent-php-nginx_8-6-${{ matrix.arch }}' + path: .ci-oci-image/php-nginx_8-6 + - + name: 'Build (load locally)' + if: "${{ github.ref == 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-nginx-dev/8.6 + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-nginx-dev:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-nginx-dev:8.6-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + - + name: 'Build (load locally, from parent artifact)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-nginx-dev/8.6 + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-nginx-dev:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-nginx-dev:8.6-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php-nginx:8.6=oci-layout://.ci-oci-image/php-nginx_8-6:ci-parent-image' + - + name: 'run serverspec' + run: |- + cd tests/serverspec + echo "FROM ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6 >> Dockerfile_test + echo "COPY conf/ /" >> Dockerfile_test + bundle install + bash serverspec.sh spec/docker/php-nginx-dev_spec.rb webdevops/php-nginx-dev:8.6 eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1uZ2lueC1kZXY6OC42IiwiRE9DS0VSX1RBRyI6IjguNiIsIk9TX0ZBTUlMWSI6ImRlYmlhbiIsIk9TX1ZFUlNJT04iOiIxMyIsIlBIUF9PRkZJQ0lBTCI6IjEiLCJET0NLRVJGSUxFIjoiRG9ja2VyZmlsZV90ZXN0In0= Dockerfile_test + - + if: "${{github.ref == 'refs/heads/master'}}" + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Push arch image' + if: "${{github.ref == 'refs/heads/master'}}" + run: 'docker push "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6' + php-nginx-dev_8-6-alpine: + strategy: + fail-fast: false + matrix: + include: + - + arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + - + arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + name: 'webdevops/php-nginx-dev:8.6-alpine (${{ matrix.arch }})' + needs: php-nginx_8-6-alpine_publish + if: '${{ !failure() && !cancelled() }}' + runs-on: '${{ matrix.runner }}' + container: webdevops/dockerfile-build-env + steps: + - + uses: actions/checkout@v7 + with: + persist-credentials: false + - + uses: docker/setup-buildx-action@v4 + - + name: 'Download parent image (OCI layout): webdevops/php-nginx:8.6-alpine' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/download-artifact@v8 + with: + name: 'docker-parent-php-nginx_8-6-alpine-${{ matrix.arch }}' + path: .ci-oci-image/php-nginx_8-6-alpine + - + name: 'Build (load locally)' + if: "${{ github.ref == 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-nginx-dev/8.6-alpine + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-nginx-dev:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-nginx-dev:8.6-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + - + name: 'Build (load locally, from parent artifact)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-nginx-dev/8.6-alpine + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-nginx-dev:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-nginx-dev:8.6-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php-nginx:8.6-alpine=oci-layout://.ci-oci-image/php-nginx_8-6-alpine:ci-parent-image' + - + name: 'run serverspec' + run: |- + cd tests/serverspec + echo "FROM ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6-alpine >> Dockerfile_test + echo "COPY conf/ /" >> Dockerfile_test + bundle install + bash serverspec.sh spec/docker/php-nginx-dev_spec.rb webdevops/php-nginx-dev:8.6-alpine eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1uZ2lueC1kZXY6OC42LWFscGluZSIsIkRPQ0tFUl9UQUciOiI4LjYtYWxwaW5lIiwiT1NfRkFNSUxZIjoiYWxwaW5lIiwiT1NfVkVSU0lPTiI6IjMiLCJQSFBfT0ZGSUNJQUwiOiIxIiwiRE9DS0VSRklMRSI6IkRvY2tlcmZpbGVfdGVzdCJ9 Dockerfile_test + - + if: "${{github.ref == 'refs/heads/master'}}" + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Push arch image' + if: "${{github.ref == 'refs/heads/master'}}" + run: 'docker push "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6-alpine' + php-nginx-dev_8-6-alpine_publish: + name: 'webdevops/php-nginx-dev:8.6-alpine - Publish' + runs-on: ubuntu-latest + needs: php-nginx-dev_8-6-alpine if: "${{github.ref == 'refs/heads/master'}}" steps: - @@ -4996,17 +5956,17 @@ jobs: set -euo pipefail for i in 1 2 3 4 5 6 7 8 9 10; do docker buildx imagetools create \ - -t "webdevops/php-nginx-dev:8.5-alpine" \ - -t "ghcr.io/webdevops/php-nginx-dev:8.5-alpine" \ - "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-amd64-8.5-alpine" \ - "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-arm64-8.5-alpine" && exit 0 + -t "webdevops/php-nginx-dev:8.6-alpine" \ + -t "ghcr.io/webdevops/php-nginx-dev:8.6-alpine" \ + "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-amd64-8.6-alpine" \ + "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-arm64-8.6-alpine" && exit 0 sleep $((i*i)) done exit 1 - php-nginx-dev_8-5_publish: - name: 'webdevops/php-nginx-dev:8.5 - Publish' + php-nginx-dev_8-6_publish: + name: 'webdevops/php-nginx-dev:8.6 - Publish' runs-on: ubuntu-latest - needs: php-nginx-dev_8-5 + needs: php-nginx-dev_8-6 if: "${{github.ref == 'refs/heads/master'}}" steps: - @@ -5030,10 +5990,10 @@ jobs: set -euo pipefail for i in 1 2 3 4 5 6 7 8 9 10; do docker buildx imagetools create \ - -t "webdevops/php-nginx-dev:8.5" \ - -t "ghcr.io/webdevops/php-nginx-dev:8.5" \ - "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-amd64-8.5" \ - "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-arm64-8.5" && exit 0 + -t "webdevops/php-nginx-dev:8.6" \ + -t "ghcr.io/webdevops/php-nginx-dev:8.6" \ + "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-amd64-8.6" \ + "ghcr.io/webdevops/php-nginx-dev:sha-${{ github.sha }}-arm64-8.6" && exit 0 sleep $((i*i)) done exit 1 @@ -6045,23 +7005,305 @@ jobs: load: true tags: 'ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}-8.5-alpine' no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" - cache-from: 'type=gha,scope=webdevops/php-nginx:8.5-alpine-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/php-nginx:8.5-alpine-${{ matrix.arch }},mode=max' + cache-from: 'type=gha,scope=webdevops/php-nginx:8.5-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-nginx:8.5-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php:8.5-alpine=oci-layout://.ci-oci-image/php_8-5-alpine:ci-parent-image' + - + name: 'run serverspec' + run: |- + cd tests/serverspec + echo "FROM ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}"-8.5-alpine >> Dockerfile_test + echo "COPY conf/ /" >> Dockerfile_test + bundle install + bash serverspec.sh spec/docker/php-nginx_spec.rb webdevops/php-nginx:8.5-alpine eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1uZ2lueDo4LjUtYWxwaW5lIiwiRE9DS0VSX1RBRyI6IjguNS1hbHBpbmUiLCJPU19GQU1JTFkiOiJhbHBpbmUiLCJPU19WRVJTSU9OIjoiMyIsIlBIUF9PRkZJQ0lBTCI6IjEiLCJET0NLRVJGSUxFIjoiRG9ja2VyZmlsZV90ZXN0In0= Dockerfile_test + - + name: 'run structure-test' + run: |- + cd tests/structure-test + /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}-8.5-alpine --config php-nginx/test.yaml + - + if: "${{github.ref == 'refs/heads/master'}}" + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Push arch image' + if: "${{github.ref == 'refs/heads/master'}}" + run: 'docker push "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}"-8.5-alpine' + - + name: 'Export image (OCI layout)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-nginx/8.5-alpine + platforms: '${{ matrix.platform }}' + cache-from: 'type=gha,scope=webdevops/php-nginx:8.5-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-nginx:8.5-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php:8.5-alpine=oci-layout://.ci-oci-image/php_8-5-alpine:ci-parent-image' + outputs: 'type=oci,tar=false,name=ci-parent-image,dest=.ci-oci-image/php-nginx_8-5-alpine' + - + name: 'Upload image (OCI layout)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/upload-artifact@v7 + with: + name: 'docker-parent-php-nginx_8-5-alpine-${{ matrix.arch }}' + path: .ci-oci-image/php-nginx_8-5-alpine + retention-days: 1 + overwrite: true + compression-level: 0 + if-no-files-found: error + php-nginx_8-5-alpine_publish: + name: 'webdevops/php-nginx:8.5-alpine - Publish' + runs-on: ubuntu-latest + needs: php-nginx_8-5-alpine + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Login to hub.docker.com' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' + - + name: 'Create and push multi-arch manifest' + run: |- + set -euo pipefail + for i in 1 2 3 4 5 6 7 8 9 10; do + docker buildx imagetools create \ + -t "webdevops/php-nginx:8.5-alpine" \ + -t "ghcr.io/webdevops/php-nginx:8.5-alpine" \ + "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-amd64-8.5-alpine" \ + "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-arm64-8.5-alpine" && exit 0 + sleep $((i*i)) + done + exit 1 + php-nginx_8-5_publish: + name: 'webdevops/php-nginx:8.5 - Publish' + runs-on: ubuntu-latest + needs: php-nginx_8-5 + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Login to hub.docker.com' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' + - + name: 'Create and push multi-arch manifest' + run: |- + set -euo pipefail + for i in 1 2 3 4 5 6 7 8 9 10; do + docker buildx imagetools create \ + -t "webdevops/php-nginx:8.5" \ + -t "ghcr.io/webdevops/php-nginx:8.5" \ + "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-amd64-8.5" \ + "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-arm64-8.5" && exit 0 + sleep $((i*i)) + done + exit 1 + php-nginx_8-6: + strategy: + fail-fast: false + matrix: + include: + - + arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + - + arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + name: 'webdevops/php-nginx:8.6 (${{ matrix.arch }})' + needs: php_8-6_publish + if: '${{ !failure() && !cancelled() }}' + runs-on: '${{ matrix.runner }}' + container: webdevops/dockerfile-build-env + steps: + - + uses: actions/checkout@v7 + with: + persist-credentials: false + - + uses: docker/setup-buildx-action@v4 + - + name: 'Download parent image (OCI layout): webdevops/php:8.6' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/download-artifact@v8 + with: + name: 'docker-parent-php_8-6-${{ matrix.arch }}' + path: .ci-oci-image/php_8-6 + - + name: 'Build (load locally)' + if: "${{ github.ref == 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-nginx/8.6 + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}-8.6' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-nginx:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-nginx:8.6-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + - + name: 'Build (load locally, from parent artifact)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-nginx/8.6 + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}-8.6' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-nginx:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-nginx:8.6-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php:8.6=oci-layout://.ci-oci-image/php_8-6:ci-parent-image' + - + name: 'run serverspec' + run: |- + cd tests/serverspec + echo "FROM ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6 >> Dockerfile_test + echo "COPY conf/ /" >> Dockerfile_test + bundle install + bash serverspec.sh spec/docker/php-nginx_spec.rb webdevops/php-nginx:8.6 eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1uZ2lueDo4LjYiLCJET0NLRVJfVEFHIjoiOC42IiwiT1NfRkFNSUxZIjoiZGViaWFuIiwiT1NfVkVSU0lPTiI6IjEzIiwiUEhQX09GRklDSUFMIjoiMSIsIkRPQ0tFUkZJTEUiOiJEb2NrZXJmaWxlX3Rlc3QifQ== Dockerfile_test + - + name: 'run structure-test' + run: |- + cd tests/structure-test + /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}-8.6 --config php-nginx/test.yaml + - + if: "${{github.ref == 'refs/heads/master'}}" + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Push arch image' + if: "${{github.ref == 'refs/heads/master'}}" + run: 'docker push "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6' + - + name: 'Export image (OCI layout)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-nginx/8.6 + platforms: '${{ matrix.platform }}' + cache-from: 'type=gha,scope=webdevops/php-nginx:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-nginx:8.6-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/php:8.6=oci-layout://.ci-oci-image/php_8-6:ci-parent-image' + outputs: 'type=oci,tar=false,name=ci-parent-image,dest=.ci-oci-image/php-nginx_8-6' + - + name: 'Upload image (OCI layout)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/upload-artifact@v7 + with: + name: 'docker-parent-php-nginx_8-6-${{ matrix.arch }}' + path: .ci-oci-image/php-nginx_8-6 + retention-days: 1 + overwrite: true + compression-level: 0 + if-no-files-found: error + php-nginx_8-6-alpine: + strategy: + fail-fast: false + matrix: + include: + - + arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + - + arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + name: 'webdevops/php-nginx:8.6-alpine (${{ matrix.arch }})' + needs: php_8-6-alpine_publish + if: '${{ !failure() && !cancelled() }}' + runs-on: '${{ matrix.runner }}' + container: webdevops/dockerfile-build-env + steps: + - + uses: actions/checkout@v7 + with: + persist-credentials: false + - + uses: docker/setup-buildx-action@v4 + - + name: 'Download parent image (OCI layout): webdevops/php:8.6-alpine' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/download-artifact@v8 + with: + name: 'docker-parent-php_8-6-alpine-${{ matrix.arch }}' + path: .ci-oci-image/php_8-6-alpine + - + name: 'Build (load locally)' + if: "${{ github.ref == 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-nginx/8.6-alpine + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-nginx:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-nginx:8.6-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + - + name: 'Build (load locally, from parent artifact)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-nginx/8.6-alpine + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php-nginx:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-nginx:8.6-alpine-${{ matrix.arch }},mode=max' build-args: 'TARGETARCH=${{ matrix.arch }}' - build-contexts: 'webdevops/php:8.5-alpine=oci-layout://.ci-oci-image/php_8-5-alpine:ci-parent-image' + build-contexts: 'webdevops/php:8.6-alpine=oci-layout://.ci-oci-image/php_8-6-alpine:ci-parent-image' - name: 'run serverspec' run: |- cd tests/serverspec - echo "FROM ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}"-8.5-alpine >> Dockerfile_test + echo "FROM ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6-alpine >> Dockerfile_test echo "COPY conf/ /" >> Dockerfile_test bundle install - bash serverspec.sh spec/docker/php-nginx_spec.rb webdevops/php-nginx:8.5-alpine eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1uZ2lueDo4LjUtYWxwaW5lIiwiRE9DS0VSX1RBRyI6IjguNS1hbHBpbmUiLCJPU19GQU1JTFkiOiJhbHBpbmUiLCJPU19WRVJTSU9OIjoiMyIsIlBIUF9PRkZJQ0lBTCI6IjEiLCJET0NLRVJGSUxFIjoiRG9ja2VyZmlsZV90ZXN0In0= Dockerfile_test + bash serverspec.sh spec/docker/php-nginx_spec.rb webdevops/php-nginx:8.6-alpine eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1uZ2lueDo4LjYtYWxwaW5lIiwiRE9DS0VSX1RBRyI6IjguNi1hbHBpbmUiLCJPU19GQU1JTFkiOiJhbHBpbmUiLCJPU19WRVJTSU9OIjoiMyIsIlBIUF9PRkZJQ0lBTCI6IjEiLCJET0NLRVJGSUxFIjoiRG9ja2VyZmlsZV90ZXN0In0= Dockerfile_test - name: 'run structure-test' run: |- cd tests/structure-test - /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}-8.5-alpine --config php-nginx/test.yaml + /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine --config php-nginx/test.yaml - if: "${{github.ref == 'refs/heads/master'}}" name: 'Login to ghcr.io' @@ -6073,34 +7315,34 @@ jobs: - name: 'Push arch image' if: "${{github.ref == 'refs/heads/master'}}" - run: 'docker push "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}"-8.5-alpine' + run: 'docker push "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6-alpine' - name: 'Export image (OCI layout)' if: "${{ github.ref != 'refs/heads/master' }}" uses: docker/build-push-action@v7 with: - context: docker/php-nginx/8.5-alpine + context: docker/php-nginx/8.6-alpine platforms: '${{ matrix.platform }}' - cache-from: 'type=gha,scope=webdevops/php-nginx:8.5-alpine-${{ matrix.arch }}' - cache-to: 'type=gha,scope=webdevops/php-nginx:8.5-alpine-${{ matrix.arch }},mode=max' + cache-from: 'type=gha,scope=webdevops/php-nginx:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php-nginx:8.6-alpine-${{ matrix.arch }},mode=max' build-args: 'TARGETARCH=${{ matrix.arch }}' - build-contexts: 'webdevops/php:8.5-alpine=oci-layout://.ci-oci-image/php_8-5-alpine:ci-parent-image' - outputs: 'type=oci,tar=false,name=ci-parent-image,dest=.ci-oci-image/php-nginx_8-5-alpine' + build-contexts: 'webdevops/php:8.6-alpine=oci-layout://.ci-oci-image/php_8-6-alpine:ci-parent-image' + outputs: 'type=oci,tar=false,name=ci-parent-image,dest=.ci-oci-image/php-nginx_8-6-alpine' - name: 'Upload image (OCI layout)' if: "${{ github.ref != 'refs/heads/master' }}" uses: actions/upload-artifact@v7 with: - name: 'docker-parent-php-nginx_8-5-alpine-${{ matrix.arch }}' - path: .ci-oci-image/php-nginx_8-5-alpine + name: 'docker-parent-php-nginx_8-6-alpine-${{ matrix.arch }}' + path: .ci-oci-image/php-nginx_8-6-alpine retention-days: 1 overwrite: true compression-level: 0 if-no-files-found: error - php-nginx_8-5-alpine_publish: - name: 'webdevops/php-nginx:8.5-alpine - Publish' + php-nginx_8-6-alpine_publish: + name: 'webdevops/php-nginx:8.6-alpine - Publish' runs-on: ubuntu-latest - needs: php-nginx_8-5-alpine + needs: php-nginx_8-6-alpine if: "${{github.ref == 'refs/heads/master'}}" steps: - @@ -6124,17 +7366,17 @@ jobs: set -euo pipefail for i in 1 2 3 4 5 6 7 8 9 10; do docker buildx imagetools create \ - -t "webdevops/php-nginx:8.5-alpine" \ - -t "ghcr.io/webdevops/php-nginx:8.5-alpine" \ - "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-amd64-8.5-alpine" \ - "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-arm64-8.5-alpine" && exit 0 + -t "webdevops/php-nginx:8.6-alpine" \ + -t "ghcr.io/webdevops/php-nginx:8.6-alpine" \ + "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-amd64-8.6-alpine" \ + "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-arm64-8.6-alpine" && exit 0 sleep $((i*i)) done exit 1 - php-nginx_8-5_publish: - name: 'webdevops/php-nginx:8.5 - Publish' + php-nginx_8-6_publish: + name: 'webdevops/php-nginx:8.6 - Publish' runs-on: ubuntu-latest - needs: php-nginx_8-5 + needs: php-nginx_8-6 if: "${{github.ref == 'refs/heads/master'}}" steps: - @@ -6158,10 +7400,10 @@ jobs: set -euo pipefail for i in 1 2 3 4 5 6 7 8 9 10; do docker buildx imagetools create \ - -t "webdevops/php-nginx:8.5" \ - -t "ghcr.io/webdevops/php-nginx:8.5" \ - "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-amd64-8.5" \ - "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-arm64-8.5" && exit 0 + -t "webdevops/php-nginx:8.6" \ + -t "ghcr.io/webdevops/php-nginx:8.6" \ + "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-amd64-8.6" \ + "ghcr.io/webdevops/php-nginx:sha-${{ github.sha }}-arm64-8.6" && exit 0 sleep $((i*i)) done exit 1 @@ -7309,6 +8551,292 @@ jobs: sleep $((i*i)) done exit 1 + php_8-6: + strategy: + fail-fast: false + matrix: + include: + - + arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + - + arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + name: 'webdevops/php:8.6 (${{ matrix.arch }})' + needs: toolbox_latest_publish + if: '${{ !failure() && !cancelled() }}' + runs-on: '${{ matrix.runner }}' + container: webdevops/dockerfile-build-env + steps: + - + uses: actions/checkout@v7 + with: + persist-credentials: false + - + uses: docker/setup-buildx-action@v4 + - + name: 'Download parent image (OCI layout): webdevops/toolbox:latest' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/download-artifact@v8 + with: + name: 'docker-parent-toolbox_latest-${{ matrix.arch }}' + path: .ci-oci-image/toolbox_latest + - + name: 'Build (load locally)' + if: "${{ github.ref == 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-official/8.6 + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php:sha-${{ github.sha }}-${{ matrix.arch }}-8.6' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php:8.6-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + - + name: 'Build (load locally, from parent artifact)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-official/8.6 + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php:sha-${{ github.sha }}-${{ matrix.arch }}-8.6' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php:8.6-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/toolbox=oci-layout://.ci-oci-image/toolbox_latest:ci-parent-image' + - + name: 'run serverspec' + run: |- + cd tests/serverspec + echo "FROM ghcr.io/webdevops/php:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6 >> Dockerfile_test + echo "COPY conf/ /" >> Dockerfile_test + bundle install + bash serverspec.sh spec/docker/php_spec.rb webdevops/php:8.6 eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1vZmZpY2lhbDo4LjYiLCJET0NLRVJfVEFHIjoiOC42IiwiT1NfRkFNSUxZIjoiZGViaWFuIiwiT1NfVkVSU0lPTiI6IjEzIiwiUEhQX09GRklDSUFMIjoiMSIsIkRPQ0tFUkZJTEUiOiJEb2NrZXJmaWxlX3Rlc3QifQ== Dockerfile_test + - + name: 'run structure-test' + run: |- + cd tests/structure-test + /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php:sha-${{ github.sha }}-${{ matrix.arch }}-8.6 --config php/test.yaml + - + if: "${{github.ref == 'refs/heads/master'}}" + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Push arch image' + if: "${{github.ref == 'refs/heads/master'}}" + run: 'docker push "ghcr.io/webdevops/php:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6' + - + name: 'Export image (OCI layout)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-official/8.6 + platforms: '${{ matrix.platform }}' + cache-from: 'type=gha,scope=webdevops/php:8.6-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php:8.6-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/toolbox=oci-layout://.ci-oci-image/toolbox_latest:ci-parent-image' + outputs: 'type=oci,tar=false,name=ci-parent-image,dest=.ci-oci-image/php_8-6' + - + name: 'Upload image (OCI layout)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/upload-artifact@v7 + with: + name: 'docker-parent-php_8-6-${{ matrix.arch }}' + path: .ci-oci-image/php_8-6 + retention-days: 1 + overwrite: true + compression-level: 0 + if-no-files-found: error + php_8-6-alpine: + strategy: + fail-fast: false + matrix: + include: + - + arch: amd64 + runner: ubuntu-24.04 + platform: linux/amd64 + - + arch: arm64 + runner: ubuntu-24.04-arm + platform: linux/arm64 + name: 'webdevops/php:8.6-alpine (${{ matrix.arch }})' + needs: toolbox_latest_publish + if: '${{ !failure() && !cancelled() }}' + runs-on: '${{ matrix.runner }}' + container: webdevops/dockerfile-build-env + steps: + - + uses: actions/checkout@v7 + with: + persist-credentials: false + - + uses: docker/setup-buildx-action@v4 + - + name: 'Download parent image (OCI layout): webdevops/toolbox:latest' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/download-artifact@v8 + with: + name: 'docker-parent-toolbox_latest-${{ matrix.arch }}' + path: .ci-oci-image/toolbox_latest + - + name: 'Build (load locally)' + if: "${{ github.ref == 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-official/8.6-alpine + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php:8.6-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + - + name: 'Build (load locally, from parent artifact)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-official/8.6-alpine + platforms: '${{ matrix.platform }}' + load: true + tags: 'ghcr.io/webdevops/php:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine' + no-cache: "${{ github.event_name == 'schedule' || github.run_attempt > 1 }}" + cache-from: 'type=gha,scope=webdevops/php:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php:8.6-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/toolbox=oci-layout://.ci-oci-image/toolbox_latest:ci-parent-image' + - + name: 'run serverspec' + run: |- + cd tests/serverspec + echo "FROM ghcr.io/webdevops/php:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6-alpine >> Dockerfile_test + echo "COPY conf/ /" >> Dockerfile_test + bundle install + bash serverspec.sh spec/docker/php_spec.rb webdevops/php:8.6-alpine eyJET0NLRVJfSU1BR0UiOiJ3ZWJkZXZvcHNcL3BocC1vZmZpY2lhbDo4LjYtYWxwaW5lIiwiRE9DS0VSX1RBRyI6IjguNi1hbHBpbmUiLCJPU19GQU1JTFkiOiJhbHBpbmUiLCJPU19WRVJTSU9OIjoiMyIsIlBIUF9PRkZJQ0lBTCI6IjEiLCJET0NLRVJGSUxFIjoiRG9ja2VyZmlsZV90ZXN0In0= Dockerfile_test + - + name: 'run structure-test' + run: |- + cd tests/structure-test + /usr/local/bin/container-structure-test test --image ghcr.io/webdevops/php:sha-${{ github.sha }}-${{ matrix.arch }}-8.6-alpine --config php/test.yaml + - + if: "${{github.ref == 'refs/heads/master'}}" + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Push arch image' + if: "${{github.ref == 'refs/heads/master'}}" + run: 'docker push "ghcr.io/webdevops/php:sha-${{ github.sha }}-${{ matrix.arch }}"-8.6-alpine' + - + name: 'Export image (OCI layout)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: docker/build-push-action@v7 + with: + context: docker/php-official/8.6-alpine + platforms: '${{ matrix.platform }}' + cache-from: 'type=gha,scope=webdevops/php:8.6-alpine-${{ matrix.arch }}' + cache-to: 'type=gha,scope=webdevops/php:8.6-alpine-${{ matrix.arch }},mode=max' + build-args: 'TARGETARCH=${{ matrix.arch }}' + build-contexts: 'webdevops/toolbox=oci-layout://.ci-oci-image/toolbox_latest:ci-parent-image' + outputs: 'type=oci,tar=false,name=ci-parent-image,dest=.ci-oci-image/php_8-6-alpine' + - + name: 'Upload image (OCI layout)' + if: "${{ github.ref != 'refs/heads/master' }}" + uses: actions/upload-artifact@v7 + with: + name: 'docker-parent-php_8-6-alpine-${{ matrix.arch }}' + path: .ci-oci-image/php_8-6-alpine + retention-days: 1 + overwrite: true + compression-level: 0 + if-no-files-found: error + php_8-6-alpine_publish: + name: 'webdevops/php:8.6-alpine - Publish' + runs-on: ubuntu-latest + needs: php_8-6-alpine + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Login to hub.docker.com' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' + - + name: 'Create and push multi-arch manifest' + run: |- + set -euo pipefail + for i in 1 2 3 4 5 6 7 8 9 10; do + docker buildx imagetools create \ + -t "webdevops/php:8.6-alpine" \ + -t "ghcr.io/webdevops/php:8.6-alpine" \ + -t "webdevops/php-official:8.6-alpine" \ + -t "ghcr.io/webdevops/php-official:8.6-alpine" \ + "ghcr.io/webdevops/php:sha-${{ github.sha }}-amd64-8.6-alpine" \ + "ghcr.io/webdevops/php:sha-${{ github.sha }}-arm64-8.6-alpine" && exit 0 + sleep $((i*i)) + done + exit 1 + php_8-6_publish: + name: 'webdevops/php:8.6 - Publish' + runs-on: ubuntu-latest + needs: php_8-6 + if: "${{github.ref == 'refs/heads/master'}}" + steps: + - + uses: docker/setup-buildx-action@v4 + - + name: 'Login to ghcr.io' + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: '${{ github.actor }}' + password: '${{ secrets.GITHUB_TOKEN }}' + - + name: 'Login to hub.docker.com' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' + - + name: 'Create and push multi-arch manifest' + run: |- + set -euo pipefail + for i in 1 2 3 4 5 6 7 8 9 10; do + docker buildx imagetools create \ + -t "webdevops/php:8.6" \ + -t "ghcr.io/webdevops/php:8.6" \ + -t "webdevops/php-official:8.6" \ + -t "ghcr.io/webdevops/php-official:8.6" \ + "ghcr.io/webdevops/php:sha-${{ github.sha }}-amd64-8.6" \ + "ghcr.io/webdevops/php:sha-${{ github.sha }}-arm64-8.6" && exit 0 + sleep $((i*i)) + done + exit 1 toolbox_latest: strategy: fail-fast: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b8fb814ff..d69d1bc10 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,8 +87,9 @@ controls extension loading. PIE requests remain unpinned, and compilation uses `nproc` parallel jobs. Protobuf, Vips and XML-RPC are built directly from their official upstream sources. -The existing XML-RPC **1.0.0RC3** pin is preserved on all supported PHP versions. -Protobuf on PHP 8.2–8.5 uses the latest upstream release. If a future release raises its minimum PHP +Vips and XML-RPC are only built for PHP 8.2–8.5 (see [PHP 8.6](docs/images/php.md#php-86-preview)). +The existing XML-RPC **1.0.0RC3** pin is preserved on those versions. +Protobuf on PHP 8.2–8.6 uses the latest upstream release. If a future release raises its minimum PHP version, older PHP image builds can fail; there is no automatic fallback to an older release. The existing CI matrix checks compatibility across PHP versions. diff --git a/README.md b/README.md index 1c6726b96..e06e84e46 100644 --- a/README.md +++ b/README.md @@ -55,59 +55,73 @@ How the files in this repository are generated, and how the images are built and ### Debian PHP -The following images which are currently supported are based on `php:{VER}-fpm-bookworm`. +The following images which are currently supported are based on `php:{VER}-fpm-bookworm` +(PHP 8.6: `php:8.6-rc-fpm-trixie`, a preview, see [PHP 8.6](docs/images/php.md#php-86-preview)). * `webdevops/php:8.2` * `webdevops/php:8.3` * `webdevops/php:8.4` * `webdevops/php:8.5` +* `webdevops/php:8.6` (preview) * `webdevops/php-dev:8.2` * `webdevops/php-dev:8.3` * `webdevops/php-dev:8.4` * `webdevops/php-dev:8.5` +* `webdevops/php-dev:8.6` (preview) * `webdevops/php-apache:8.2` * `webdevops/php-apache:8.3` * `webdevops/php-apache:8.4` * `webdevops/php-apache:8.5` +* `webdevops/php-apache:8.6` (preview) * `webdevops/php-apache-dev:8.2` * `webdevops/php-apache-dev:8.3` * `webdevops/php-apache-dev:8.4` * `webdevops/php-apache-dev:8.5` +* `webdevops/php-apache-dev:8.6` (preview) * `webdevops/php-nginx:8.2` * `webdevops/php-nginx:8.3` * `webdevops/php-nginx:8.4` * `webdevops/php-nginx:8.5` +* `webdevops/php-nginx:8.6` (preview) * `webdevops/php-nginx-dev:8.2` * `webdevops/php-nginx-dev:8.3` * `webdevops/php-nginx-dev:8.4` * `webdevops/php-nginx-dev:8.5` +* `webdevops/php-nginx-dev:8.6` (preview) ### Alpine PHP -The following images which are currently supported are based on `php:{VER}-fpm-alpine`. +The following images which are currently supported are based on `php:{VER}-fpm-alpine` +(PHP 8.6: `php:8.6-rc-fpm-alpine`, a preview, see [PHP 8.6](docs/images/php.md#php-86-preview)). * `webdevops/php:8.2-alpine` * `webdevops/php:8.3-alpine` * `webdevops/php:8.4-alpine` * `webdevops/php:8.5-alpine` +* `webdevops/php:8.6-alpine` (preview) * `webdevops/php-dev:8.2-alpine` * `webdevops/php-dev:8.3-alpine` * `webdevops/php-dev:8.4-alpine` * `webdevops/php-dev:8.5-alpine` +* `webdevops/php-dev:8.6-alpine` (preview) * `webdevops/php-apache:8.2-alpine` * `webdevops/php-apache:8.3-alpine` * `webdevops/php-apache:8.4-alpine` * `webdevops/php-apache:8.5-alpine` +* `webdevops/php-apache:8.6-alpine` (preview) * `webdevops/php-apache-dev:8.2-alpine` * `webdevops/php-apache-dev:8.3-alpine` * `webdevops/php-apache-dev:8.4-alpine` * `webdevops/php-apache-dev:8.5-alpine` +* `webdevops/php-apache-dev:8.6-alpine` (preview) * `webdevops/php-nginx:8.2-alpine` * `webdevops/php-nginx:8.3-alpine` * `webdevops/php-nginx:8.4-alpine` * `webdevops/php-nginx:8.5-alpine` +* `webdevops/php-nginx:8.6-alpine` (preview) * `webdevops/php-nginx-dev:8.2-alpine` * `webdevops/php-nginx-dev:8.3-alpine` * `webdevops/php-nginx-dev:8.4-alpine` * `webdevops/php-nginx-dev:8.5-alpine` +* `webdevops/php-nginx-dev:8.6-alpine` (preview) diff --git a/conf/console.yml b/conf/console.yml index a649dd17a..f80d5f8ed 100644 --- a/conf/console.yml +++ b/conf/console.yml @@ -21,3 +21,7 @@ dockerTest: OS_FAMILY: 'debian' OS_VERSION: '12' PHP_OFFICIAL: '1' + 'php[^:]*:8.6$': + OS_FAMILY: 'debian' + OS_VERSION: '13' + PHP_OFFICIAL: '1' diff --git a/docker/php-apache-dev/8.2/Dockerfile b/docker/php-apache-dev/8.2/Dockerfile index e5d4863c4..8f23a9bfe 100644 --- a/docker/php-apache-dev/8.2/Dockerfile +++ b/docker/php-apache-dev/8.2/Dockerfile @@ -20,8 +20,9 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ diff --git a/docker/php-apache-dev/8.3/Dockerfile b/docker/php-apache-dev/8.3/Dockerfile index cc2c2d2a6..4b2befb85 100644 --- a/docker/php-apache-dev/8.3/Dockerfile +++ b/docker/php-apache-dev/8.3/Dockerfile @@ -20,8 +20,9 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ diff --git a/docker/php-apache-dev/8.4/Dockerfile b/docker/php-apache-dev/8.4/Dockerfile index 8a83dac05..6d22671a1 100644 --- a/docker/php-apache-dev/8.4/Dockerfile +++ b/docker/php-apache-dev/8.4/Dockerfile @@ -20,8 +20,9 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ diff --git a/docker/php-apache-dev/8.5/Dockerfile b/docker/php-apache-dev/8.5/Dockerfile index c55eab490..3d4ff85eb 100644 --- a/docker/php-apache-dev/8.5/Dockerfile +++ b/docker/php-apache-dev/8.5/Dockerfile @@ -20,8 +20,9 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ diff --git a/docker/php-apache-dev/8.6-alpine/Dockerfile b/docker/php-apache-dev/8.6-alpine/Dockerfile new file mode 100644 index 000000000..0c56fd87f --- /dev/null +++ b/docker/php-apache-dev/8.6-alpine/Dockerfile @@ -0,0 +1,51 @@ +#+++++++++++++++++++++++++++++++++++++++ +# Dockerfile for webdevops/php-apache-dev:8.6-alpine +# -- automatically generated -- +#+++++++++++++++++++++++++++++++++++++++ + +FROM webdevops/php-apache:8.6-alpine + +ENV WEB_DOCUMENT_ROOT=/app \ + WEB_DOCUMENT_INDEX=index.php \ + WEB_ALIAS_DOMAIN=*.vm \ + WEB_PHP_TIMEOUT=600 \ + WEB_PHP_SOCKET="" +ENV WEB_PHP_SOCKET=127.0.0.1:9000 +ENV WEB_NO_CACHE_PATTERN="\.(css|js|gif|png|jpg|svg|json|xml)$" + +COPY conf/ /opt/docker/ + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + # Install development environment + && bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ + # TODO PHP 8.6: `blackfire php:install` installs the glibc probe on Alpine with ZTS; + # install the Alpine probe directly + && mkdir -p /tmp/blackfire \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 "https://blackfire.io/api/v1/releases/probe/php/alpine/$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')/86-zts" | tar xz -C /tmp/blackfire \ + && mv /tmp/blackfire/blackfire-*.so "$(php -r 'echo ini_get("extension_dir");')/blackfire.so" \ + && printf '[blackfire]\nextension=blackfire.so\n' > /usr/local/etc/php/conf.d/99-blackfire.ini \ + && rm -rf /tmp/blackfire \ + && apk-install \ + linux-headers \ + make \ + autoconf \ + g++ \ + libtool \ + pkgconf \ + && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ + --skip-enable-extension --make-parallel-jobs="$(nproc)" "xdebug/xdebug:^3.6@alpha" \ + && rm -rf /tmp/pie \ + && apk del -f --purge \ + autoconf \ + linux-headers \ + g++ \ + make \ + libtool \ + pkgconf \ + && docker-php-ext-enable xdebug \ + # Enable php development services + && docker-service enable syslog \ + && docker-service enable postfix \ + && docker-service enable ssh \ + && docker-run-bootstrap diff --git a/docker/php-apache-dev/8.6-alpine/Dockerfile.twig b/docker/php-apache-dev/8.6-alpine/Dockerfile.twig new file mode 100644 index 000000000..92c64c922 --- /dev/null +++ b/docker/php-apache-dev/8.6-alpine/Dockerfile.twig @@ -0,0 +1,16 @@ +{% import 'docker.twig' as docker %} +{% import 'provision.twig' as provision %} +{% import 'environment.twig' as environment %} +{% import 'images/php.twig' as php %} +{{ docker.from("php-apache", "8.6-alpine") }} + +{{ environment.web() }} +{{ environment.webPhp() }} +{{ environment.webDevelopment() }} + +{{ docker.copy('conf/', '/opt/docker/') }} + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + {{ php.officialDevelopmentAlpine(version="8.6") }} \ + {{ provision.runBootstrap() }} diff --git a/docker/php-apache-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.d/10-init.sh b/docker/php-apache-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.d/10-init.sh new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docker/php-apache-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.d/10-init.sh @@ -0,0 +1 @@ +# placeholder diff --git a/docker/php-apache-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.sh b/docker/php-apache-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.sh new file mode 100644 index 000000000..95daa01ae --- /dev/null +++ b/docker/php-apache-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_BLACKFIRE_AGENT_OPTS" ]]; then SERVICE_BLACKFIRE_AGENT_OPTS=""; fi + +source /opt/docker/bin/config.sh + +BLACKFIRE_ARGS="" + +includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" + +# blackfire.server_id +if [[ -n "${BLACKFIRE_SERVER_ID+x}" ]]; then + BLACKFIRE_ARGS="$BLACKFIRE_ARGS --server-id=\"${BLACKFIRE_SERVER_ID}\"" +fi + +# blackfire.server_token +if [[ -n "${BLACKFIRE_SERVER_TOKEN+x}" ]]; then + BLACKFIRE_ARGS="$BLACKFIRE_ARGS --server-token=\"${BLACKFIRE_SERVER_TOKEN}\"" +fi + +# create directory for unix socket +mkdir -p /var/run/blackfire + +eval exec blackfire-agent $BLACKFIRE_ARGS $SERVICE_BLACKFIRE_AGENT_OPTS diff --git a/docker/php-apache-dev/8.6-alpine/conf/etc/httpd/conf.d/02-dev.conf b/docker/php-apache-dev/8.6-alpine/conf/etc/httpd/conf.d/02-dev.conf new file mode 100644 index 000000000..75e5f4396 --- /dev/null +++ b/docker/php-apache-dev/8.6-alpine/conf/etc/httpd/conf.d/02-dev.conf @@ -0,0 +1,8 @@ +# EnableSendfile: Control whether the sendfile kernel support is +# used to deliver files (assuming that the OS supports it). +# The default is on; turn this off if you serve from NFS-mounted +# filesystems. Please see +# http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile +EnableSendfile off + +LogLevel info diff --git a/docker/php-apache-dev/8.6-alpine/conf/etc/httpd/vhost.common.d/.gitkeep b/docker/php-apache-dev/8.6-alpine/conf/etc/httpd/vhost.common.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-apache-dev/8.6-alpine/conf/etc/httpd/vhost.common.d/02-dev.conf b/docker/php-apache-dev/8.6-alpine/conf/etc/httpd/vhost.common.d/02-dev.conf new file mode 100644 index 000000000..54918ec2b --- /dev/null +++ b/docker/php-apache-dev/8.6-alpine/conf/etc/httpd/vhost.common.d/02-dev.conf @@ -0,0 +1,10 @@ +"> + FileETag None + + + Header unset ETag + Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT" + + diff --git a/docker/php-apache-dev/8.6-alpine/conf/etc/supervisor.d/blackfire-agent.conf b/docker/php-apache-dev/8.6-alpine/conf/etc/supervisor.d/blackfire-agent.conf new file mode 100644 index 000000000..897831ddb --- /dev/null +++ b/docker/php-apache-dev/8.6-alpine/conf/etc/supervisor.d/blackfire-agent.conf @@ -0,0 +1,14 @@ +[group:blackfire-agent] +programs=blackfire-agentd +priority=25 + +[program:blackfire-agentd] +command = /opt/docker/bin/service.d/blackfire-agent.sh +process_name=%(program_name)s +startsecs = 0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-apache-dev/8.6-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache-dev/8.6-alpine/conf/provision/bootstrap.d/10-php.sh new file mode 100644 index 000000000..d100a7e41 --- /dev/null +++ b/docker/php-apache-dev/8.6-alpine/conf/provision/bootstrap.d/10-php.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Configure php-fpm +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*access.format[\s]*=' -r 'access.format = "%R - %u %t \"%m %r%Q%q\" %s %f cpu:%C%% mem:%{megabytes}M reqTime:%d"' \ + -- /opt/docker/etc/php/fpm/pool.d/application.conf + +# Listen on port 9000 of all addresses: PHP-FPM binds to [::] (IPv6 and IPv4) +# and falls back to 0.0.0.0 if the container has no IPv6 +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' diff --git a/docker/php-apache-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-opcache.sh b/docker/php-apache-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-opcache.sh new file mode 100644 index 000000000..0bbb940b4 --- /dev/null +++ b/docker/php-apache-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-opcache.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Configure opcache for development +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*opcache.memory_consumption[\s]*=' -r 'opcache.memory_consumption = 256' \ + -s '^[\s;]*opcache.validate_timestamps[\s]*=' -r 'opcache.validate_timestamps = 1' \ + -s '^[\s;]*opcache.revalidate_freq[\s]*=' -r 'opcache.revalidate_freq = 0' \ + -s '^[\s;]*opcache.interned_strings_buffer[\s]*=' -r 'opcache.interned_strings_buffer = 16' \ + -s '^[\s;]*opcache.max_accelerated_files[\s]*=' -r 'opcache.max_accelerated_files = 7963' \ + -- /opt/docker/etc/php/php.webdevops.ini diff --git a/docker/php-apache-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-xdebug.sh b/docker/php-apache-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-xdebug.sh new file mode 100644 index 000000000..63f5aeab9 --- /dev/null +++ b/docker/php-apache-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-xdebug.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Configure xdebug for development +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*xdebug.mode[\s]*=' -r 'xdebug.mode = debug' \ + -s '^[\s;]*xdebug.discover_client_host[\s]*=' -r 'xdebug.discover_client_host = 1' \ + -s '^[\s;]*xdebug.idekey[\s]*=' -r 'xdebug.idekey = docker' \ + -s '^[\s;]*xdebug.cli_color[\s]*=' -r 'xdebug.cli_color = 1' \ + -s '^[\s;]*xdebug.max_nesting_level[\s]*=' -r 'xdebug.max_nesting_level = 1000' \ + -s '^[\s;]*xdebug.start_with_request[\s]*=' -r 'xdebug.start_with_request = trigger' \ + -s '^[\s;]*xdebug.output_dir[\s]*=' -r 'xdebug.output_dir = /tmp/debug' \ + -- /opt/docker/etc/php/php.webdevops.ini diff --git a/docker/php-apache-dev/8.6-alpine/conf/provision/entrypoint.d/10-php-debugger.sh b/docker/php-apache-dev/8.6-alpine/conf/provision/entrypoint.d/10-php-debugger.sh new file mode 100644 index 000000000..32f646e55 --- /dev/null +++ b/docker/php-apache-dev/8.6-alpine/conf/provision/entrypoint.d/10-php-debugger.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash + +################################################# +# Debugger switch +################################################# + +PHP_CONF_PATHS="/usr/local/etc/php/conf.d/" + +function phpModuleRemove() { + if [ "$#" -ne 1 ]; then + echo "You must specify the name of the PHP module which you want to disable" + exit 1 + fi + + echo " - Removing PHP module ${1}" + for CONF_PATH in $PHP_CONF_PATHS; do + rm -f "${CONF_PATH}"/*"${1}".ini + done +} + + +if [[ -n "${PHP_DEBUGGER+x}" ]]; then + case "$PHP_DEBUGGER" in + xdebug) + echo "PHP-Debugger: Xdebug enabled" + phpModuleRemove "blackfire" + ;; + + blackfire) + echo "PHP-Debugger: Blackfire enabled" + phpModuleRemove "xdebug" + docker-service-enable blackfire-agent + ;; + + none) + echo "PHP-Debugger: none" + phpModuleRemove "blackfire" + phpModuleRemove "xdebug" + ;; + esac + +else + + echo "PHP-Debugger: not specified - default is xdebug" + phpModuleRemove "blackfire" + +fi + +################################################# +# PHP debugger environment variables +################################################# + +function phpEnvironmentVariable() { + PHP_INI_KEY="$1" + PHP_ENV_NAME="$2" + + if [[ -n "${!PHP_ENV_NAME+x}" ]]; then + PHP_ENV_VALUE="${!PHP_ENV_NAME}" + echo "${PHP_INI_KEY}=\"${PHP_ENV_VALUE}\"" >> /opt/docker/etc/php/php.ini + fi +} + +################### +# XDEBUG +################### + +# xdebug3 remote debugger +phpEnvironmentVariable "xdebug.discover_client_host" "XDEBUG_DISCOVER_CLIENT_HOST" +phpEnvironmentVariable "xdebug.mode" "XDEBUG_MODE" +phpEnvironmentVariable "xdebug.start_with_request" "XDEBUG_START_WITH_REQUEST" +phpEnvironmentVariable "xdebug.client_host" "XDEBUG_CLIENT_HOST" +phpEnvironmentVariable "xdebug.client_port" "XDEBUG_CLIENT_PORT" + +# xdebug3 profiler +phpEnvironmentVariable "xdebug.trigger_value" "XDEBUG_TRIGGER_VALUE" +phpEnvironmentVariable "xdebug.output_dir" "XDEBUG_OUTPUT_DIR" + +################### +# BLACKFIRE +################### +phpEnvironmentVariable "blackfire.server_id" "BLACKFIRE_SERVER_ID" +phpEnvironmentVariable "blackfire.server_token" "BLACKFIRE_SERVER_TOKEN" diff --git a/docker/php-apache-dev/8.6-alpine/conf/provision/entrypoint.d/20-apache-dev.sh b/docker/php-apache-dev/8.6-alpine/conf/provision/entrypoint.d/20-apache-dev.sh new file mode 100644 index 000000000..a9d2c6e92 --- /dev/null +++ b/docker/php-apache-dev/8.6-alpine/conf/provision/entrypoint.d/20-apache-dev.sh @@ -0,0 +1,5 @@ +go-replace \ + -s "" -r "$WEB_NO_CACHE_PATTERN" \ + --path=/opt/docker/etc/httpd/ \ + --path-pattern='*.conf' \ + --ignore-empty diff --git a/docker/php-apache-dev/8.6/Dockerfile b/docker/php-apache-dev/8.6/Dockerfile new file mode 100644 index 000000000..065f328be --- /dev/null +++ b/docker/php-apache-dev/8.6/Dockerfile @@ -0,0 +1,34 @@ +#+++++++++++++++++++++++++++++++++++++++ +# Dockerfile for webdevops/php-apache-dev:8.6 +# -- automatically generated -- +#+++++++++++++++++++++++++++++++++++++++ + +FROM webdevops/php-apache:8.6 + +ENV WEB_DOCUMENT_ROOT=/app \ + WEB_DOCUMENT_INDEX=index.php \ + WEB_ALIAS_DOMAIN=*.vm \ + WEB_PHP_TIMEOUT=600 \ + WEB_PHP_SOCKET="" +ENV WEB_PHP_SOCKET=127.0.0.1:9000 +ENV WEB_NO_CACHE_PATTERN="\.(css|js|gif|png|jpg|svg|json|xml)$" + +COPY conf/ /opt/docker/ + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + # Install development environment + && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ + && blackfire php:install \ + # TODO PHP 8.6: Tideways is not installed yet, tideways-php 5.47.0 crashes + # PHP 8.6.0RC4 (ZTS) on startup + && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ + --skip-enable-extension --make-parallel-jobs="$(nproc)" "xdebug/xdebug:^3.6@alpha" \ + && rm -rf /tmp/pie \ + && docker-php-ext-enable xdebug \ + # Enable php development services + && docker-service enable syslog \ + && docker-service enable postfix \ + && docker-service enable ssh \ + && docker-run-bootstrap \ + && docker-image-cleanup diff --git a/docker/php-apache-dev/8.6/Dockerfile.twig b/docker/php-apache-dev/8.6/Dockerfile.twig new file mode 100644 index 000000000..8827a2bf4 --- /dev/null +++ b/docker/php-apache-dev/8.6/Dockerfile.twig @@ -0,0 +1,17 @@ +{% import 'docker.twig' as docker %} +{% import 'provision.twig' as provision %} +{% import 'environment.twig' as environment %} +{% import 'images/php.twig' as php %} +{{ docker.from("php-apache", "8.6") }} + +{{ environment.web() }} +{{ environment.webPhp() }} +{{ environment.webDevelopment() }} + +{{ docker.copy('conf/', '/opt/docker/') }} + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + {{ php.officialDevelopment(version="8.6") }} \ + {{ provision.runBootstrap() }} \ + {{ docker.cleanup() }} diff --git a/docker/php-apache-dev/8.6/conf/bin/service.d/blackfire-agent.d/10-init.sh b/docker/php-apache-dev/8.6/conf/bin/service.d/blackfire-agent.d/10-init.sh new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docker/php-apache-dev/8.6/conf/bin/service.d/blackfire-agent.d/10-init.sh @@ -0,0 +1 @@ +# placeholder diff --git a/docker/php-apache-dev/8.6/conf/bin/service.d/blackfire-agent.sh b/docker/php-apache-dev/8.6/conf/bin/service.d/blackfire-agent.sh new file mode 100644 index 000000000..95daa01ae --- /dev/null +++ b/docker/php-apache-dev/8.6/conf/bin/service.d/blackfire-agent.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_BLACKFIRE_AGENT_OPTS" ]]; then SERVICE_BLACKFIRE_AGENT_OPTS=""; fi + +source /opt/docker/bin/config.sh + +BLACKFIRE_ARGS="" + +includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" + +# blackfire.server_id +if [[ -n "${BLACKFIRE_SERVER_ID+x}" ]]; then + BLACKFIRE_ARGS="$BLACKFIRE_ARGS --server-id=\"${BLACKFIRE_SERVER_ID}\"" +fi + +# blackfire.server_token +if [[ -n "${BLACKFIRE_SERVER_TOKEN+x}" ]]; then + BLACKFIRE_ARGS="$BLACKFIRE_ARGS --server-token=\"${BLACKFIRE_SERVER_TOKEN}\"" +fi + +# create directory for unix socket +mkdir -p /var/run/blackfire + +eval exec blackfire-agent $BLACKFIRE_ARGS $SERVICE_BLACKFIRE_AGENT_OPTS diff --git a/docker/php-apache-dev/8.6/conf/etc/httpd/conf.d/02-dev.conf b/docker/php-apache-dev/8.6/conf/etc/httpd/conf.d/02-dev.conf new file mode 100644 index 000000000..75e5f4396 --- /dev/null +++ b/docker/php-apache-dev/8.6/conf/etc/httpd/conf.d/02-dev.conf @@ -0,0 +1,8 @@ +# EnableSendfile: Control whether the sendfile kernel support is +# used to deliver files (assuming that the OS supports it). +# The default is on; turn this off if you serve from NFS-mounted +# filesystems. Please see +# http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile +EnableSendfile off + +LogLevel info diff --git a/docker/php-apache-dev/8.6/conf/etc/httpd/vhost.common.d/.gitkeep b/docker/php-apache-dev/8.6/conf/etc/httpd/vhost.common.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-apache-dev/8.6/conf/etc/httpd/vhost.common.d/02-dev.conf b/docker/php-apache-dev/8.6/conf/etc/httpd/vhost.common.d/02-dev.conf new file mode 100644 index 000000000..54918ec2b --- /dev/null +++ b/docker/php-apache-dev/8.6/conf/etc/httpd/vhost.common.d/02-dev.conf @@ -0,0 +1,10 @@ +"> + FileETag None + + + Header unset ETag + Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT" + + diff --git a/docker/php-apache-dev/8.6/conf/etc/supervisor.d/blackfire-agent.conf b/docker/php-apache-dev/8.6/conf/etc/supervisor.d/blackfire-agent.conf new file mode 100644 index 000000000..897831ddb --- /dev/null +++ b/docker/php-apache-dev/8.6/conf/etc/supervisor.d/blackfire-agent.conf @@ -0,0 +1,14 @@ +[group:blackfire-agent] +programs=blackfire-agentd +priority=25 + +[program:blackfire-agentd] +command = /opt/docker/bin/service.d/blackfire-agent.sh +process_name=%(program_name)s +startsecs = 0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-apache-dev/8.6/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache-dev/8.6/conf/provision/bootstrap.d/10-php.sh new file mode 100644 index 000000000..d100a7e41 --- /dev/null +++ b/docker/php-apache-dev/8.6/conf/provision/bootstrap.d/10-php.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Configure php-fpm +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*access.format[\s]*=' -r 'access.format = "%R - %u %t \"%m %r%Q%q\" %s %f cpu:%C%% mem:%{megabytes}M reqTime:%d"' \ + -- /opt/docker/etc/php/fpm/pool.d/application.conf + +# Listen on port 9000 of all addresses: PHP-FPM binds to [::] (IPv6 and IPv4) +# and falls back to 0.0.0.0 if the container has no IPv6 +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' diff --git a/docker/php-apache-dev/8.6/conf/provision/bootstrap.d/20-php-module-opcache.sh b/docker/php-apache-dev/8.6/conf/provision/bootstrap.d/20-php-module-opcache.sh new file mode 100644 index 000000000..0bbb940b4 --- /dev/null +++ b/docker/php-apache-dev/8.6/conf/provision/bootstrap.d/20-php-module-opcache.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Configure opcache for development +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*opcache.memory_consumption[\s]*=' -r 'opcache.memory_consumption = 256' \ + -s '^[\s;]*opcache.validate_timestamps[\s]*=' -r 'opcache.validate_timestamps = 1' \ + -s '^[\s;]*opcache.revalidate_freq[\s]*=' -r 'opcache.revalidate_freq = 0' \ + -s '^[\s;]*opcache.interned_strings_buffer[\s]*=' -r 'opcache.interned_strings_buffer = 16' \ + -s '^[\s;]*opcache.max_accelerated_files[\s]*=' -r 'opcache.max_accelerated_files = 7963' \ + -- /opt/docker/etc/php/php.webdevops.ini diff --git a/docker/php-apache-dev/8.6/conf/provision/bootstrap.d/20-php-module-xdebug.sh b/docker/php-apache-dev/8.6/conf/provision/bootstrap.d/20-php-module-xdebug.sh new file mode 100644 index 000000000..63f5aeab9 --- /dev/null +++ b/docker/php-apache-dev/8.6/conf/provision/bootstrap.d/20-php-module-xdebug.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Configure xdebug for development +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*xdebug.mode[\s]*=' -r 'xdebug.mode = debug' \ + -s '^[\s;]*xdebug.discover_client_host[\s]*=' -r 'xdebug.discover_client_host = 1' \ + -s '^[\s;]*xdebug.idekey[\s]*=' -r 'xdebug.idekey = docker' \ + -s '^[\s;]*xdebug.cli_color[\s]*=' -r 'xdebug.cli_color = 1' \ + -s '^[\s;]*xdebug.max_nesting_level[\s]*=' -r 'xdebug.max_nesting_level = 1000' \ + -s '^[\s;]*xdebug.start_with_request[\s]*=' -r 'xdebug.start_with_request = trigger' \ + -s '^[\s;]*xdebug.output_dir[\s]*=' -r 'xdebug.output_dir = /tmp/debug' \ + -- /opt/docker/etc/php/php.webdevops.ini diff --git a/docker/php-apache-dev/8.6/conf/provision/entrypoint.d/10-php-debugger.sh b/docker/php-apache-dev/8.6/conf/provision/entrypoint.d/10-php-debugger.sh new file mode 100644 index 000000000..32f646e55 --- /dev/null +++ b/docker/php-apache-dev/8.6/conf/provision/entrypoint.d/10-php-debugger.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash + +################################################# +# Debugger switch +################################################# + +PHP_CONF_PATHS="/usr/local/etc/php/conf.d/" + +function phpModuleRemove() { + if [ "$#" -ne 1 ]; then + echo "You must specify the name of the PHP module which you want to disable" + exit 1 + fi + + echo " - Removing PHP module ${1}" + for CONF_PATH in $PHP_CONF_PATHS; do + rm -f "${CONF_PATH}"/*"${1}".ini + done +} + + +if [[ -n "${PHP_DEBUGGER+x}" ]]; then + case "$PHP_DEBUGGER" in + xdebug) + echo "PHP-Debugger: Xdebug enabled" + phpModuleRemove "blackfire" + ;; + + blackfire) + echo "PHP-Debugger: Blackfire enabled" + phpModuleRemove "xdebug" + docker-service-enable blackfire-agent + ;; + + none) + echo "PHP-Debugger: none" + phpModuleRemove "blackfire" + phpModuleRemove "xdebug" + ;; + esac + +else + + echo "PHP-Debugger: not specified - default is xdebug" + phpModuleRemove "blackfire" + +fi + +################################################# +# PHP debugger environment variables +################################################# + +function phpEnvironmentVariable() { + PHP_INI_KEY="$1" + PHP_ENV_NAME="$2" + + if [[ -n "${!PHP_ENV_NAME+x}" ]]; then + PHP_ENV_VALUE="${!PHP_ENV_NAME}" + echo "${PHP_INI_KEY}=\"${PHP_ENV_VALUE}\"" >> /opt/docker/etc/php/php.ini + fi +} + +################### +# XDEBUG +################### + +# xdebug3 remote debugger +phpEnvironmentVariable "xdebug.discover_client_host" "XDEBUG_DISCOVER_CLIENT_HOST" +phpEnvironmentVariable "xdebug.mode" "XDEBUG_MODE" +phpEnvironmentVariable "xdebug.start_with_request" "XDEBUG_START_WITH_REQUEST" +phpEnvironmentVariable "xdebug.client_host" "XDEBUG_CLIENT_HOST" +phpEnvironmentVariable "xdebug.client_port" "XDEBUG_CLIENT_PORT" + +# xdebug3 profiler +phpEnvironmentVariable "xdebug.trigger_value" "XDEBUG_TRIGGER_VALUE" +phpEnvironmentVariable "xdebug.output_dir" "XDEBUG_OUTPUT_DIR" + +################### +# BLACKFIRE +################### +phpEnvironmentVariable "blackfire.server_id" "BLACKFIRE_SERVER_ID" +phpEnvironmentVariable "blackfire.server_token" "BLACKFIRE_SERVER_TOKEN" diff --git a/docker/php-apache-dev/8.6/conf/provision/entrypoint.d/20-apache-dev.sh b/docker/php-apache-dev/8.6/conf/provision/entrypoint.d/20-apache-dev.sh new file mode 100644 index 000000000..a9d2c6e92 --- /dev/null +++ b/docker/php-apache-dev/8.6/conf/provision/entrypoint.d/20-apache-dev.sh @@ -0,0 +1,5 @@ +go-replace \ + -s "" -r "$WEB_NO_CACHE_PATTERN" \ + --path=/opt/docker/etc/httpd/ \ + --path-pattern='*.conf' \ + --ignore-empty diff --git a/docker/php-apache/8.6-alpine/Dockerfile b/docker/php-apache/8.6-alpine/Dockerfile new file mode 100644 index 000000000..0d26331ef --- /dev/null +++ b/docker/php-apache/8.6-alpine/Dockerfile @@ -0,0 +1,33 @@ +#+++++++++++++++++++++++++++++++++++++++ +# Dockerfile for webdevops/php-apache:8.6-alpine +# -- automatically generated -- +#+++++++++++++++++++++++++++++++++++++++ + +FROM webdevops/php:8.6-alpine + +ENV WEB_DOCUMENT_ROOT=/app \ + WEB_DOCUMENT_INDEX=index.php \ + WEB_ALIAS_DOMAIN=*.vm \ + WEB_PHP_TIMEOUT=600 \ + WEB_PHP_SOCKET="" +ENV WEB_PHP_SOCKET=127.0.0.1:9000 + +COPY conf/ /opt/docker/ + +RUN set -x \ + # Install apache + && apk-install \ + apache2 \ + apache2-ctl \ + apache2-utils \ + apache2-proxy \ + apache2-ssl \ + # Fix issue with module loading order of lbmethod_* (see https://serverfault.com/questions/922573/apache2-fails-to-start-after-recent-update-to-2-4-34-no-clue-why) + && sed -i '2,5{H;d}; ${p;x;s/^\n//}' /etc/apache2/conf.d/proxy.conf \ + && sed -ri ' \ + s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; \ + s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g; \ + ' /etc/apache2/httpd.conf \ + && docker-run-bootstrap + +EXPOSE 80 443 diff --git a/docker/php-apache/8.6-alpine/Dockerfile.twig b/docker/php-apache/8.6-alpine/Dockerfile.twig new file mode 100644 index 000000000..92a896aff --- /dev/null +++ b/docker/php-apache/8.6-alpine/Dockerfile.twig @@ -0,0 +1,16 @@ +{% import 'docker.twig' as docker %} +{% import 'provision.twig' as provision %} +{% import 'environment.twig' as environment %} +{% import 'images/apache.twig' as apache %} +{{ docker.from("php", "8.6-alpine") }} + +{{ environment.web() }} +{{ environment.webPhp() }} + +{{ docker.copy('conf/', '/opt/docker/') }} + +RUN set -x \ + {{ apache.alpine() }} \ + {{ provision.runBootstrap() }} + +{{ docker.expose('80 443') }} diff --git a/docker/php-apache/8.6-alpine/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/8.6-alpine/conf/bin/service.d/httpd.d/10-init.sh new file mode 100644 index 000000000..4ef318a1e --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/bin/service.d/httpd.d/10-init.sh @@ -0,0 +1,6 @@ +if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then + echo "" + echo "[WARNING] WEB_DOCUMENT_ROOT does not exists with path \"$WEB_DOCUMENT_ROOT\"!" + echo "" +fi + diff --git a/docker/php-apache/8.6-alpine/conf/bin/service.d/httpd.sh b/docker/php-apache/8.6-alpine/conf/bin/service.d/httpd.sh new file mode 100644 index 000000000..f88544c62 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/bin/service.d/httpd.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_APACHE_OPTS" ]]; then SERVICE_APACHE_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/httpd.d/" + +# Apache gets grumpy about PID files pre-existing +rm -f /var/run/httpd/httpd.pid + +exec /usr/sbin/apachectl -DFOREGROUND $SERVICE_APACHE_OPTS diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/.gitkeep b/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-error-document.conf b/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-error-document.conf new file mode 100644 index 000000000..ebabf87e4 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-error-document.conf @@ -0,0 +1,15 @@ +####################################### +# Faster error documents +####################################### + + ErrorDocument 400 "400 Bad Request" + ErrorDocument 401 "401 Unauthorized" + ErrorDocument 403 "403 Forbidden" + ErrorDocument 404 "404 Not Found" + ErrorDocument 405 "405 Method Not Allowed" + + ErrorDocument 500 "500 Internal Server Error" + ErrorDocument 501 "501 Not Implemented" + ErrorDocument 502 "502 Bad Gateway" + ErrorDocument 503 "503 Service Unavailable" + diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-log.conf b/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-log.conf new file mode 100644 index 000000000..950e45105 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-log.conf @@ -0,0 +1,4 @@ +LogFormat "[httpd:access] %V:%p %{X-Forwarded-For}i - %h %l %u %t \"%r\" %>s bytesIn:%I bytesOut:%O reqTime:%T" dockerlog +LogLevel warn +CustomLog /docker.stdout dockerlog +ErrorLog /docker.stderr diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-php.conf b/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-php.conf new file mode 100644 index 000000000..cd62792e2 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-php.conf @@ -0,0 +1,37 @@ +############################# +# mod_proxy_fcgi +# official solution +# apache 2.4 and later +############################# + + + > + ProxySet connectiontimeout=5 timeout= + + + + SetHandler "proxy:fcgi://" + + + +############################# +# mod_fastcgi +# apaache 2.2 and 2.4 +############################# + + + AddHandler php-fcgi .php + Action php-fcgi /php-fcgi + Alias /php-fcgi /usr/lib/cgi-bin/php-fcgi + FastCgiExternalServer /usr/lib/cgi-bin/php-fcgi -host "" -pass-header Authorization -idle-timeout + + + + Allow from all + + = 2.4> + Require all granted + + + + diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-server.conf b/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-server.conf new file mode 100644 index 000000000..80b971734 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/conf.d/10-server.conf @@ -0,0 +1,18 @@ +# Settings +TimeOut 1000 +ServerName "" + +DirectoryIndex +DocumentRoot "" + +"> + Options FollowSymLinks + AllowOverride All + + + Allow from all + + = 2.4> + Require all granted + + diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/global.conf b/docker/php-apache/8.6-alpine/conf/etc/httpd/global.conf new file mode 100644 index 000000000..b6141db09 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/global.conf @@ -0,0 +1 @@ +# deprecated diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/main.conf b/docker/php-apache/8.6-alpine/conf/etc/httpd/main.conf new file mode 100644 index 000000000..fb04614ca --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/main.conf @@ -0,0 +1,10 @@ +Include /opt/docker/etc/httpd/global.conf +Include /opt/docker/etc/httpd/php.conf + + + Include /opt/docker/etc/httpd/conf.d/*.conf + += 2.4> + IncludeOptional /opt/docker/etc/httpd/conf.d/*.conf + +Include /opt/docker/etc/httpd/vhost.conf diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/php.conf b/docker/php-apache/8.6-alpine/conf/etc/httpd/php.conf new file mode 100644 index 000000000..b6141db09 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/php.conf @@ -0,0 +1 @@ +# deprecated diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/ssl/server.crt b/docker/php-apache/8.6-alpine/conf/etc/httpd/ssl/server.crt new file mode 100644 index 000000000..6b0694907 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/ssl/server.crt @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIE1DCCArwCCQDMMwGnSuK0tTANBgkqhkiG9w0BAQsFADAsMRswGQYDVQQKExJE +b2NrZXIgQm9pbGVycGxhdGUxDTALBgNVBAMUBCoudm0wHhcNMTUwNTA0MTcxNDQw +WhcNMjUwNTAxMTcxNDQwWjAsMRswGQYDVQQKExJEb2NrZXIgQm9pbGVycGxhdGUx +DTALBgNVBAMUBCoudm0wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDK +3TIUiyDvXelWeY9VXMrpjuZtYpVSDsACLpjFUhMnsP5/iKT0VbeZyqHvmwZjAg4G +Y10d+yZDdgv/xeu0HPOFbtR6pCp10d1tdLHZto5Cyuxu7IQsAVjnD6Ko7XFwtNk7 +9o6JZfAFaGL4w5MokrVmCtspnsMZH7/7zU4f96cbF39zLopnpuXGD6t6DA8Qj3gy +0duaTjs42bYRN+rwLzVKAev99iQ4kPMJn4vV6/Xk6rtoSzC67GQyVZYaFypicD1S +NtsRmgEVvjCBDbrLOneUiRwff6qxEsZi7Hxv7BKFj4iUWnII7K/nP7T6uBHQjHO+ +FpsGkU9lCMrCeVFBe8kKz/cbhd+yLUxXwAPr6gSOPmwn232Gy4tozvqZHpbUxsgx +7sT3ej9K66h1D7J+BjNFWYM1hbnC1r7H/xS7EBzBV8qRoQCVe08Juf5xsouXFakD +clLV4+L+1cxkpwsCQDly5g3tm/TBqA2O+ZJ+YHQDHKkzMyhLs6i0X/M5qvJBiLg1 +GLTCS20rpQ5gXTEGuINqHgwXQWkUO6bhgSYqdHGX3zbZ5+qWpI4eui3dHZ1Ll0VH +6Icpb7ORTQwhc6W8KBlybssYPSlGOEBGUjYGNheoz9FpoSkxCis+P8ZNKtrmpPoq +Su0eOOGFOFHG02eOgPVxSwrDeN9MVJo7BPysGMHJmQIDAQABMA0GCSqGSIb3DQEB +CwUAA4ICAQC63g6NHmQKbiy3G6iaDkpUSbr5Mq2YgU61XnvWVyREqDcy/BXCw9oY +SJ/KUvCpqPnACNOFqjadRAmPiA9nf2WduoCgwQGV/YRFGswSuVvh/3X2TX5NWvbS +t8MQDttQg1dxpiMUjlu3rqhfohBdWJvp2lVSdpDb/MOlXBc/+p7HfOHwhqB7wwPN +NNbSKUbZqZxmD8cOf1X0hASr1yfFPj+2vST3ESaON8S0T2p63YX/sD5jvOUiEuyw +I5WcvLmiRZA07SH8nWyckLY3qWL+OlhSZrlAnolWS00b+7h5LNuRYEjKzwVgntoA +aCopyQih6wIk0+AfJO4sfhJBmQhnIrAaP/zwBH5g9zVizLf5H7U+hNXrMwgw55Sq +vjMdkZHvPKUXTvVit/rYE9H+PY3brkRWzOl4V/i/ZLJJm5805H/NyTbz9kPMJw2Q +nn+KOpfXXySD39f8iuRgSKXsYNul38hxWgcZZ6g+sOOp2n/VUmf0eZUWNnJ8i7AP +4Qif7aDKMcibOwSwsB+DKZXDvZ5XSdnMphtuLS5rPSL81rVRmWC2DMfQ2eP8j0WN +VTroSk0xedQ7Qr+9TNooi9IyzX6n1a2S1UiciEZ3ZcDbXPl/P01m+IYZyPnLv0+9 +ZeioZYh1JLv3/OKsMrMLTfh2ZCj3aXwmc2Owi/wU2LS5QUOMcHH7CQ== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/ssl/server.csr b/docker/php-apache/8.6-alpine/conf/etc/httpd/ssl/server.csr new file mode 100644 index 000000000..8a9909f77 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/ssl/server.csr @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEcTCCAlkCAQAwLDEbMBkGA1UEChMSRG9ja2VyIEJvaWxlcnBsYXRlMQ0wCwYD +VQQDFAQqLnZtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAyt0yFIsg +713pVnmPVVzK6Y7mbWKVUg7AAi6YxVITJ7D+f4ik9FW3mcqh75sGYwIOBmNdHfsm +Q3YL/8XrtBzzhW7UeqQqddHdbXSx2baOQsrsbuyELAFY5w+iqO1xcLTZO/aOiWXw +BWhi+MOTKJK1ZgrbKZ7DGR+/+81OH/enGxd/cy6KZ6blxg+regwPEI94MtHbmk47 +ONm2ETfq8C81SgHr/fYkOJDzCZ+L1ev15Oq7aEswuuxkMlWWGhcqYnA9UjbbEZoB +Fb4wgQ26yzp3lIkcH3+qsRLGYux8b+wShY+IlFpyCOyv5z+0+rgR0IxzvhabBpFP +ZQjKwnlRQXvJCs/3G4Xfsi1MV8AD6+oEjj5sJ9t9hsuLaM76mR6W1MbIMe7E93o/ +SuuodQ+yfgYzRVmDNYW5wta+x/8UuxAcwVfKkaEAlXtPCbn+cbKLlxWpA3JS1ePi +/tXMZKcLAkA5cuYN7Zv0wagNjvmSfmB0AxypMzMoS7OotF/zOaryQYi4NRi0wktt +K6UOYF0xBriDah4MF0FpFDum4YEmKnRxl9822efqlqSOHrot3R2dS5dFR+iHKW+z +kU0MIXOlvCgZcm7LGD0pRjhARlI2BjYXqM/RaaEpMQorPj/GTSra5qT6KkrtHjjh +hThRxtNnjoD1cUsKw3jfTFSaOwT8rBjByZkCAwEAAaAAMA0GCSqGSIb3DQEBCwUA +A4ICAQBsEBgC2YepuZq/8UqvKMZKVy/etDKXj7BB+QPb+leNiKD7p4LDxHJsZSH8 +Ku9uMPeLfiQDn5jA41k5SlGttzvObd65RdEbO3yHpqsg05EGSDDLfaE1k2Al/qmX +/o8roPZF7+2kZthgMAgkcokS54LYqEYTGqOf3J9Ss0yRIZwhaOVebfFIbIOdpw0B +JNMIJPHTMdZrcuRVI+wR1uPLIlEJzBvxTGbTrvPU25WJFtu+EajKqXO0SHdy0yx8 +uH4ykRBJRc36+oYo7nZ5D56dh7pZn3+9J64FKAOV0Q3KqMFieGy053ezuhJd70eZ +UozTgfjs3WpMzoYmKETSyl3XZSdInRe+sUlKPruTsKyg69oYxjPlrGfAmmGcCFca +TnZinT18dI92zK7OtOVkmYeYKC1lwuhftVrNMXzZuHOGpS9NNYtc4nDqDMIEOfV3 +6rCdu03WjEgJ+Z67tJs16xOx9du4/EHxS2Ijn9DPfVJvYy0TgzDi1BUpjWx0KTLx +C4OQbEZ/QTWmHVbSch/hcZhzbf7SNh5RpnW4EtmcpDFjIKMfxJmoKeiTf7qnilx0 +7uRvsZFKoDKRDOFiPfgMg5AOtLHziYsd9m0tJjC2GHvFuPjzOtzhnUUjmmvht170 +2aqKakjST4amg7jzLcs871HX0/WjOtt29NpOz140blkKf1bisg== +-----END CERTIFICATE REQUEST----- \ No newline at end of file diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/ssl/server.key b/docker/php-apache/8.6-alpine/conf/etc/httpd/ssl/server.key new file mode 100644 index 000000000..c9eec145f --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/ssl/server.key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAyt0yFIsg713pVnmPVVzK6Y7mbWKVUg7AAi6YxVITJ7D+f4ik +9FW3mcqh75sGYwIOBmNdHfsmQ3YL/8XrtBzzhW7UeqQqddHdbXSx2baOQsrsbuyE +LAFY5w+iqO1xcLTZO/aOiWXwBWhi+MOTKJK1ZgrbKZ7DGR+/+81OH/enGxd/cy6K +Z6blxg+regwPEI94MtHbmk47ONm2ETfq8C81SgHr/fYkOJDzCZ+L1ev15Oq7aEsw +uuxkMlWWGhcqYnA9UjbbEZoBFb4wgQ26yzp3lIkcH3+qsRLGYux8b+wShY+IlFpy +COyv5z+0+rgR0IxzvhabBpFPZQjKwnlRQXvJCs/3G4Xfsi1MV8AD6+oEjj5sJ9t9 +hsuLaM76mR6W1MbIMe7E93o/SuuodQ+yfgYzRVmDNYW5wta+x/8UuxAcwVfKkaEA +lXtPCbn+cbKLlxWpA3JS1ePi/tXMZKcLAkA5cuYN7Zv0wagNjvmSfmB0AxypMzMo +S7OotF/zOaryQYi4NRi0wkttK6UOYF0xBriDah4MF0FpFDum4YEmKnRxl9822efq +lqSOHrot3R2dS5dFR+iHKW+zkU0MIXOlvCgZcm7LGD0pRjhARlI2BjYXqM/RaaEp +MQorPj/GTSra5qT6KkrtHjjhhThRxtNnjoD1cUsKw3jfTFSaOwT8rBjByZkCAwEA +AQKCAgAbZPdoUsllyZbC+LNkYZ19ILD5QIDNjfRb1xMGQmkXyQz1B+zOmeyrNfPc +OWEJabOfJTfj3pByN7SzG3US4333HNpQnW6mbmqqZ0HFFqPrXR/Ecuf+UUhCG5hp +m3bgM2vKbyccYsmg0VHcKfzrU7RvTTP/UNMjx2fThwvvwS+ttuSdF0HVcXJB5sfP +OWWnZNhkdHZlRf81VCED/jsZqCZYEh5eMyj9AoXvXL4zayPPf+tC0DSKaXW2Xlxg +tZQhqup8+a9nlxZia0Z9hu8clo6jXkiP8FuKgfCMV0cOjiCKLLHS5svTbLLsVWwJ +F2ZAdVcD6mWQ43qHOEK5NEzGvQKO14CaOLnVT2yAkMcyNohsEgoDP9oCBGDJQbBH +NmtZfpVjjtuTr9P9TEkU1FcBRo0x6Il/DkzamGbOeFAmgnaGElhJ5c/CAG7whaIf +mUfFOBGPH/wESY3gBOACDofeSh27RrlvbLaPiCGKivDUTBmhBsIuso6XqOKbvtfV +/HhhndpdRVfIj4DdE7gIrLIGN977JMVAXFCNz7KrvAWwcOXrCHCoWpklJ9repq8l +26ICY8K7VXktzDHQUmhd88ZWR+9ASURsJghUgZUOcMrEGyvci6Y8hpLhHiNVPHuQ ++ps7tpPsXSntBUqWBzhRZh74+nJlOOV6oYykl30JT2JzB6lwiQKCAQEA9ecn8N2z +20tR2UEiTv/MjVSepQtAAajegvcd1iasvvQKXnh3XLmoZHzH2tTa0lp5RIZpUQPl +lOTwko0lYTBnYblt65AJQ3FTgisNobIpoqE8BFXLm6wggz7CbabjmPGDe173lPGR +sI0YSKYvzrdn4zw8Fh6WULJyZHLi58zJYL3r0WBDiOoxpGaGA1GlmkuIWjhKHaX2 +OvF1vOuQDJ2eDyTc5TYFC0NKG76Mvanov5L/yrhNM/umbmp0SPspzHGZobAKUr20 +OazFT8S+2TA1OTxWNbiPbSimFoaZbEdqsNACGfVJWO8Sh8iqlt5RmEcSiSvGBj6L +QKprRO9Fsp2GawKCAQEA0zGhRsnux4JTNsdUSYsEJtITMj6eE+nl7CoZ9DAOwC5X +6/aSpUE4TT+pWNrt9iluXiGL0j89UJ7r/L1OcsiyzGb8ig9NU4zr1NIGTZ0DstHi +HPYINjeiBJEFIy17kOQn+9/I5c4hBUwz6ihwNoEomymVB/EsLJKAML0AudJGKg+Z +/f/qrS40eab5SAiaKgsh0MZnj+vIxyGBydt6r2HGmjfNITVbXIu6IpO+6NXDwM/e +7v10AAZ3j9+gb1RedLg2ghuIuYU90hmMhtVWsh9nVmaOkMW9/WFgOPYvt/mHH/hR +d4pePZ9kACGmqo/b9sHvHw1YEubtCt1VUiNuFxnJCwKCAQBWnxz0vkRTJY8phsY9 +KeK2jm5sGTBs5T2syLwb6ffENFdKvAjgAw6Mh2And/+1ReWd+/MxdLv03UjZdxsJ +x3FDfXx5FH4O4ebW3a+pnAcKoN1xcX+N0O6LDRqUYcue3sTAOs3gC9CUbr91KAWD +Phw8ccWAzTmKJ7IgLFA982ekyoI9eTmRC159WRgwJxy844qerWF+XC4GyXP+HsTZ +jNRW5Vdi7sqMEyIR7+fIEAhLI88zbATWIPmZv6pC4ybwO7wwtsCMMQNBpdjDprzL +6S12ggikV+U+QKlxGe0FtYqhykRTPJKf32eZqVheWOZJTA/9fgv9ux52oxGycM8O +gmsNAoIBAQC60m5uZnd5uYnPLWkcXYNgq/kbO1UvHHut/FhVMKX7z4MrU0XKNfWO +MECoP5K9bU0aq+Y6KIMe7FapjvT0iSHRu1Cu+HZY8JI2A0xcIAeDijLRl7sP6wrB +q1+2DKgANjRAlWfsEfoX658JBpitPngjOheBnRCMpVQMyUT5HE/BKWf5zwdUB0mY +S+K8nA90HcDeJIS8RcGolbVwUV0oBABhr/cf50lYhqozqCr7YQ33ZGs7Uq3oz8+4 +UARmN2YPLl3Znm3GX12em8c6B0LX8vvA7Jw06Rf2Ksup1+3Ce1PTLiEy9A4FyRf3 +Hc2HmBbnJAtZlr5QikMqlzzAmmLqwH6dAoIBAC+ryaQGJFsijCSuaDfRp/uy9xnd +DjgMdTwjl5WLBmyudChVMANl8eqCbvVO41CN84yORk03oQ4cx0eKxAZaLaSzgkb3 +W0X2nFQe7VJSYMQswCQ+1WfJvEFrIdkEKIa//uQdhqNrgUKSNVhhSTMbNEkDTIWn +ssbv2H9hvUaFt/J/vP9zCKuU5oYvNU7Oi6ZXRYezRn9atlJYanLFoJnHUBRzGms5 +K0vhdCPDXQq87z5Yudoh0jLUQF9Nx0GTWeBceQ9n5hZeRUNQWxP4AJThQX9KSPTS +mbL3Kh4XNRmAUJ2N+Njh+3dg91s+JkKvC1wcspLsmLPQe+9AxBSH9y5JE/8= +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.common.conf b/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.common.conf new file mode 100644 index 000000000..384696b4e --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.common.conf @@ -0,0 +1,7 @@ +# compatibility for PHP and TYPO3 Docker Boilerplate + + Include /opt/docker/etc/httpd/vhost.common.d/*.conf + + = 2.4> + IncludeOptional /opt/docker/etc/httpd/vhost.common.d/*.conf + diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.common.d/.gitkeep b/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.common.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.common.d/01-boilerplate.conf b/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.common.d/01-boilerplate.conf new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.common.d/01-boilerplate.conf @@ -0,0 +1 @@ +# placeholder diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.conf b/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.conf new file mode 100644 index 000000000..c04a94318 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.conf @@ -0,0 +1,36 @@ +####################################### +# Vhost +####################################### + + + ServerName docker.vm + ServerAlias + DocumentRoot "" + + UseCanonicalName Off + + + Include /opt/docker/etc/httpd/vhost.common.d/*.conf + + = 2.4> + IncludeOptional /opt/docker/etc/httpd/vhost.common.d/*.conf + + + + + + ServerName docker.vm + ServerAlias + DocumentRoot "" + + UseCanonicalName Off + + + Include /opt/docker/etc/httpd/vhost.common.d/*.conf + + = 2.4> + IncludeOptional /opt/docker/etc/httpd/vhost.common.d/*.conf + + + Include /opt/docker/etc/httpd/vhost.ssl.conf + diff --git a/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.ssl.conf b/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.ssl.conf new file mode 100644 index 000000000..cf5fbc604 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/httpd/vhost.ssl.conf @@ -0,0 +1,26 @@ + ############ + # SSL + ############ + + SSLEngine on + SSLCertificateFile /opt/docker/etc/httpd/ssl/server.crt + SSLCertificateKeyFile /opt/docker/etc/httpd/ssl/server.key + + + SSLOptions +StdEnvVars + + + SSLOptions +StdEnvVars + + + BrowserMatch "MSIE [2-6]" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + # MSIE 7 and newer should be able to use keepalive + # This regexp is ok with 17-9! + BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown + + ## SSL Hardening + SSLProtocol All -SSLv2 -SSLv3 + SSLHonorCipherOrder on + SSLCipherSuite 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA' diff --git a/docker/php-apache/8.6-alpine/conf/etc/supervisor.d/apache.conf b/docker/php-apache/8.6-alpine/conf/etc/supervisor.d/apache.conf new file mode 100644 index 000000000..12a6f86f7 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/etc/supervisor.d/apache.conf @@ -0,0 +1,14 @@ +[group:apache] +programs=apached +priority=20 + +[program:apached] +command = /opt/docker/bin/service.d/httpd.sh +process_name=%(program_name)s +startsecs = 0 +autostart = true +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-apache/8.6-alpine/conf/provision/bootstrap.d/.gitkeep b/docker/php-apache/8.6-alpine/conf/provision/bootstrap.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-apache/8.6-alpine/conf/provision/bootstrap.d/10-apache.sh b/docker/php-apache/8.6-alpine/conf/provision/bootstrap.d/10-apache.sh new file mode 100644 index 000000000..e9feb08b4 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/provision/bootstrap.d/10-apache.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) +IMAGE_DISTRIBUTION=$(docker-image-info dist) +IMAGE_DISTRIBUTION_VERSION=$(docker-image-info dist-version) +IMAGE_DISTRIBUTION_VERSION_MAIN=$(echo "$IMAGE_DISTRIBUTION_VERSION" | sed 's/^\([0-9]*\).*/\1/g') + +# Collect environment variables +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + APACHE_MAIN_PATH=/etc/apache2/ + APACHE_DOCKER_VHOST=/etc/apache2/sites-enabled/10-docker.conf + ;; + + RedHat) + APACHE_MAIN_PATH=/etc/httpd/ + APACHE_DOCKER_VHOST=/etc/httpd/conf.d/zzz-docker.conf + ;; + + Alpine) + APACHE_MAIN_PATH=/etc/apache2/ + APACHE_DOCKER_VHOST=/etc/apache2/conf.d/zzz-docker.conf + ;; +esac + +# Enable apache main config +ln -sf -- /opt/docker/etc/httpd/main.conf "$APACHE_DOCKER_VHOST" + +# Ensure /var/run/apache2 exists +mkdir -p -- "/var/run/apache2" + +if [[ "$IMAGE_FAMILY" == "Alpine" ]]; then + mkdir -p -- "/run/apache2" +fi + +# Maintain lock directory +if [[ "$IMAGE_FAMILY" == "Debian" ]]; then + mkdir -p -- "/var/lock/apache2" + chmod 0750 -- "/var/lock/apache2" + chown www-data:www-data -- "/var/lock/apache2" +fi + +APACHE_CONF_FILES=$(find "$APACHE_MAIN_PATH" -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log') + +# Change log to Docker stdout +go-replace --regex --regex-backrefs \ + -s '^[\s]*(CustomLog|ErrorLog|TransferLog) ([^\s]+)(.*)' -r '$1 /docker.stdout $3' \ + -s '^[\s]*(ErrorLog) ([^\s]+)(.*)' -r '$1 /docker.stderr $3' \ + --path="$APACHE_MAIN_PATH" \ + --path-regex='(.*\.conf|default.*|.*log)$' + +# Switch MPM to event +if [[ "$IMAGE_FAMILY" == "RedHat" ]]; then + go-replace --mode=line --regex --regex-backrefs \ + -s '^[\s#]*(LoadModule mpm_prefork_module.*)' -r '#$1' \ + -s '^[\s#]*(LoadModule mpm_event_module.*)' -r '$1' \ + -- /etc/httpd/conf.modules.d/00-mpm.conf +fi + +if [[ "$IMAGE_DISTRIBUTION" == "Ubuntu" ]] && [[ "$IMAGE_DISTRIBUTION_VERSION_MAIN" -ge 14 ]]; then + a2enmod mpm_event +fi + +if [[ "$IMAGE_DISTRIBUTION" == "Debian" ]] && [[ "$IMAGE_DISTRIBUTION_VERSION_MAIN" -ge 8 ]]; then + a2enmod mpm_event +fi + +if [[ "$IMAGE_FAMILY" == "Alpine" ]]; then + go-replace --mode=line --regex --regex-backrefs \ + -s '^[\s#]*(LoadModule mpm_prefork_module.*)' -r '#$1' \ + -s '^[\s#]*(LoadModule mpm_event_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule deflate_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule rewrite_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule logio_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule slotmem_shm_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule actions_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule expires_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule ssl_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule socache_shmcb_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule proxy_ajp_module.*)' -r '#$1' \ + -s '^[\s#]*(LoadModule proxy_connect_module.*)' -r '#$1' \ + -s '^[\s#]*(LoadModule proxy_balancer_module.*)' -r '#$1' \ + -s '^[\s#]*(LoadModule proxy_express_module.*)' -r '#$1' \ + -s '^[\s#]*(LoadModule proxy_fcgi_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule proxy_fdpass_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule proxy_ftp_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule proxy_http_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule proxy_scgi_module.*)' -r '$1' \ + -- /etc/apache2/httpd.conf \ + /etc/apache2/conf.d/ssl.conf \ + /etc/apache2/conf.d/proxy.conf + + # Remove default vhost + sed -i -e '1h;2,$H;$!d;g' -e 's//#-> removed vhost/g' /etc/apache2/conf.d/ssl.conf +fi + +# Fix rights of ssl files +chown -R root:root /opt/docker/etc/httpd/ssl +find /opt/docker/etc/httpd/ssl -type d -exec chmod 750 {} \; +find /opt/docker/etc/httpd/ssl -type f -exec chmod 640 {} \; diff --git a/docker/php-apache/8.6-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache/8.6-alpine/conf/provision/bootstrap.d/10-php.sh new file mode 100644 index 000000000..c8669ca25 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/provision/bootstrap.d/10-php.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Restrict php-fpm to local connection +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 127.0.0.1:9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' + diff --git a/docker/php-apache/8.6-alpine/conf/provision/entrypoint.d/.gitkeep b/docker/php-apache/8.6-alpine/conf/provision/entrypoint.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-apache/8.6-alpine/conf/provision/entrypoint.d/20-apache.sh b/docker/php-apache/8.6-alpine/conf/provision/entrypoint.d/20-apache.sh new file mode 100644 index 000000000..42ef48932 --- /dev/null +++ b/docker/php-apache/8.6-alpine/conf/provision/entrypoint.d/20-apache.sh @@ -0,0 +1,16 @@ +# Replace markers +go-replace \ + -s "" -r "$WEB_DOCUMENT_INDEX" \ + -s "" -r "$WEB_DOCUMENT_ROOT" \ + -s "" -r "$WEB_ALIAS_DOMAIN" \ + -s "" -r "$HOSTNAME" \ + -s "" -r "$WEB_PHP_SOCKET" \ + -s "" -r "$WEB_PHP_TIMEOUT" \ + --path=/opt/docker/etc/httpd/ \ + --path-pattern='*.conf' \ + --ignore-empty + +if [[ -z "$WEB_PHP_SOCKET" ]]; then + ## WEB_PHP_SOCKET is not set, remove PHP files + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf +fi diff --git a/docker/php-apache/8.6/Dockerfile b/docker/php-apache/8.6/Dockerfile new file mode 100644 index 000000000..c92863c60 --- /dev/null +++ b/docker/php-apache/8.6/Dockerfile @@ -0,0 +1,30 @@ +#+++++++++++++++++++++++++++++++++++++++ +# Dockerfile for webdevops/php-apache:8.6 +# -- automatically generated -- +#+++++++++++++++++++++++++++++++++++++++ + +FROM webdevops/php:8.6 + +ENV WEB_DOCUMENT_ROOT=/app \ + WEB_DOCUMENT_INDEX=index.php \ + WEB_ALIAS_DOMAIN=*.vm \ + WEB_PHP_TIMEOUT=600 \ + WEB_PHP_SOCKET="" +ENV WEB_PHP_SOCKET=127.0.0.1:9000 + +COPY conf/ /opt/docker/ + +RUN set -x \ + # Install apache + && apt-install \ + apache2 \ + && sed -ri ' \ + s!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g; \ + s!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g; \ + ' /etc/apache2/apache2.conf \ + && rm -f /etc/apache2/sites-enabled/* \ + && a2enmod actions proxy proxy_fcgi ssl rewrite headers expires \ + && docker-run-bootstrap \ + && docker-image-cleanup + +EXPOSE 80 443 diff --git a/docker/php-apache/8.6/Dockerfile.twig b/docker/php-apache/8.6/Dockerfile.twig new file mode 100644 index 000000000..7303e5c2c --- /dev/null +++ b/docker/php-apache/8.6/Dockerfile.twig @@ -0,0 +1,17 @@ +{% import 'docker.twig' as docker %} +{% import 'provision.twig' as provision %} +{% import 'environment.twig' as environment %} +{% import 'images/apache.twig' as apache %} +{{ docker.from("php", "8.6") }} + +{{ environment.web() }} +{{ environment.webPhp() }} + +{{ docker.copy('conf/', '/opt/docker/') }} + +RUN set -x \ + {{ apache.debian() }} \ + {{ provision.runBootstrap() }} \ + {{ docker.cleanup() }} + +{{ docker.expose('80 443') }} diff --git a/docker/php-apache/8.6/conf/bin/service.d/httpd.d/10-init.sh b/docker/php-apache/8.6/conf/bin/service.d/httpd.d/10-init.sh new file mode 100644 index 000000000..4ef318a1e --- /dev/null +++ b/docker/php-apache/8.6/conf/bin/service.d/httpd.d/10-init.sh @@ -0,0 +1,6 @@ +if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then + echo "" + echo "[WARNING] WEB_DOCUMENT_ROOT does not exists with path \"$WEB_DOCUMENT_ROOT\"!" + echo "" +fi + diff --git a/docker/php-apache/8.6/conf/bin/service.d/httpd.sh b/docker/php-apache/8.6/conf/bin/service.d/httpd.sh new file mode 100644 index 000000000..1d871e7ea --- /dev/null +++ b/docker/php-apache/8.6/conf/bin/service.d/httpd.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_APACHE_OPTS" ]]; then SERVICE_APACHE_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/httpd.d/" + +# Apache gets grumpy about PID files pre-existing +rm -f /var/run/apache2/apache2*.pid + +source /etc/apache2/envvars +exec apache2 -DFOREGROUND -DAPACHE_LOCK_DIR $SERVICE_APACHE_OPTS diff --git a/docker/php-apache/8.6/conf/etc/httpd/conf.d/.gitkeep b/docker/php-apache/8.6/conf/etc/httpd/conf.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-apache/8.6/conf/etc/httpd/conf.d/10-error-document.conf b/docker/php-apache/8.6/conf/etc/httpd/conf.d/10-error-document.conf new file mode 100644 index 000000000..ebabf87e4 --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/conf.d/10-error-document.conf @@ -0,0 +1,15 @@ +####################################### +# Faster error documents +####################################### + + ErrorDocument 400 "400 Bad Request" + ErrorDocument 401 "401 Unauthorized" + ErrorDocument 403 "403 Forbidden" + ErrorDocument 404 "404 Not Found" + ErrorDocument 405 "405 Method Not Allowed" + + ErrorDocument 500 "500 Internal Server Error" + ErrorDocument 501 "501 Not Implemented" + ErrorDocument 502 "502 Bad Gateway" + ErrorDocument 503 "503 Service Unavailable" + diff --git a/docker/php-apache/8.6/conf/etc/httpd/conf.d/10-log.conf b/docker/php-apache/8.6/conf/etc/httpd/conf.d/10-log.conf new file mode 100644 index 000000000..950e45105 --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/conf.d/10-log.conf @@ -0,0 +1,4 @@ +LogFormat "[httpd:access] %V:%p %{X-Forwarded-For}i - %h %l %u %t \"%r\" %>s bytesIn:%I bytesOut:%O reqTime:%T" dockerlog +LogLevel warn +CustomLog /docker.stdout dockerlog +ErrorLog /docker.stderr diff --git a/docker/php-apache/8.6/conf/etc/httpd/conf.d/10-php.conf b/docker/php-apache/8.6/conf/etc/httpd/conf.d/10-php.conf new file mode 100644 index 000000000..cd62792e2 --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/conf.d/10-php.conf @@ -0,0 +1,37 @@ +############################# +# mod_proxy_fcgi +# official solution +# apache 2.4 and later +############################# + + + > + ProxySet connectiontimeout=5 timeout= + + + + SetHandler "proxy:fcgi://" + + + +############################# +# mod_fastcgi +# apaache 2.2 and 2.4 +############################# + + + AddHandler php-fcgi .php + Action php-fcgi /php-fcgi + Alias /php-fcgi /usr/lib/cgi-bin/php-fcgi + FastCgiExternalServer /usr/lib/cgi-bin/php-fcgi -host "" -pass-header Authorization -idle-timeout + + + + Allow from all + + = 2.4> + Require all granted + + + + diff --git a/docker/php-apache/8.6/conf/etc/httpd/conf.d/10-server.conf b/docker/php-apache/8.6/conf/etc/httpd/conf.d/10-server.conf new file mode 100644 index 000000000..80b971734 --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/conf.d/10-server.conf @@ -0,0 +1,18 @@ +# Settings +TimeOut 1000 +ServerName "" + +DirectoryIndex +DocumentRoot "" + +"> + Options FollowSymLinks + AllowOverride All + + + Allow from all + + = 2.4> + Require all granted + + diff --git a/docker/php-apache/8.6/conf/etc/httpd/global.conf b/docker/php-apache/8.6/conf/etc/httpd/global.conf new file mode 100644 index 000000000..b6141db09 --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/global.conf @@ -0,0 +1 @@ +# deprecated diff --git a/docker/php-apache/8.6/conf/etc/httpd/main.conf b/docker/php-apache/8.6/conf/etc/httpd/main.conf new file mode 100644 index 000000000..fb04614ca --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/main.conf @@ -0,0 +1,10 @@ +Include /opt/docker/etc/httpd/global.conf +Include /opt/docker/etc/httpd/php.conf + + + Include /opt/docker/etc/httpd/conf.d/*.conf + += 2.4> + IncludeOptional /opt/docker/etc/httpd/conf.d/*.conf + +Include /opt/docker/etc/httpd/vhost.conf diff --git a/docker/php-apache/8.6/conf/etc/httpd/php.conf b/docker/php-apache/8.6/conf/etc/httpd/php.conf new file mode 100644 index 000000000..b6141db09 --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/php.conf @@ -0,0 +1 @@ +# deprecated diff --git a/docker/php-apache/8.6/conf/etc/httpd/ssl/server.crt b/docker/php-apache/8.6/conf/etc/httpd/ssl/server.crt new file mode 100644 index 000000000..6b0694907 --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/ssl/server.crt @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIE1DCCArwCCQDMMwGnSuK0tTANBgkqhkiG9w0BAQsFADAsMRswGQYDVQQKExJE +b2NrZXIgQm9pbGVycGxhdGUxDTALBgNVBAMUBCoudm0wHhcNMTUwNTA0MTcxNDQw +WhcNMjUwNTAxMTcxNDQwWjAsMRswGQYDVQQKExJEb2NrZXIgQm9pbGVycGxhdGUx +DTALBgNVBAMUBCoudm0wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDK +3TIUiyDvXelWeY9VXMrpjuZtYpVSDsACLpjFUhMnsP5/iKT0VbeZyqHvmwZjAg4G +Y10d+yZDdgv/xeu0HPOFbtR6pCp10d1tdLHZto5Cyuxu7IQsAVjnD6Ko7XFwtNk7 +9o6JZfAFaGL4w5MokrVmCtspnsMZH7/7zU4f96cbF39zLopnpuXGD6t6DA8Qj3gy +0duaTjs42bYRN+rwLzVKAev99iQ4kPMJn4vV6/Xk6rtoSzC67GQyVZYaFypicD1S +NtsRmgEVvjCBDbrLOneUiRwff6qxEsZi7Hxv7BKFj4iUWnII7K/nP7T6uBHQjHO+ +FpsGkU9lCMrCeVFBe8kKz/cbhd+yLUxXwAPr6gSOPmwn232Gy4tozvqZHpbUxsgx +7sT3ej9K66h1D7J+BjNFWYM1hbnC1r7H/xS7EBzBV8qRoQCVe08Juf5xsouXFakD +clLV4+L+1cxkpwsCQDly5g3tm/TBqA2O+ZJ+YHQDHKkzMyhLs6i0X/M5qvJBiLg1 +GLTCS20rpQ5gXTEGuINqHgwXQWkUO6bhgSYqdHGX3zbZ5+qWpI4eui3dHZ1Ll0VH +6Icpb7ORTQwhc6W8KBlybssYPSlGOEBGUjYGNheoz9FpoSkxCis+P8ZNKtrmpPoq +Su0eOOGFOFHG02eOgPVxSwrDeN9MVJo7BPysGMHJmQIDAQABMA0GCSqGSIb3DQEB +CwUAA4ICAQC63g6NHmQKbiy3G6iaDkpUSbr5Mq2YgU61XnvWVyREqDcy/BXCw9oY +SJ/KUvCpqPnACNOFqjadRAmPiA9nf2WduoCgwQGV/YRFGswSuVvh/3X2TX5NWvbS +t8MQDttQg1dxpiMUjlu3rqhfohBdWJvp2lVSdpDb/MOlXBc/+p7HfOHwhqB7wwPN +NNbSKUbZqZxmD8cOf1X0hASr1yfFPj+2vST3ESaON8S0T2p63YX/sD5jvOUiEuyw +I5WcvLmiRZA07SH8nWyckLY3qWL+OlhSZrlAnolWS00b+7h5LNuRYEjKzwVgntoA +aCopyQih6wIk0+AfJO4sfhJBmQhnIrAaP/zwBH5g9zVizLf5H7U+hNXrMwgw55Sq +vjMdkZHvPKUXTvVit/rYE9H+PY3brkRWzOl4V/i/ZLJJm5805H/NyTbz9kPMJw2Q +nn+KOpfXXySD39f8iuRgSKXsYNul38hxWgcZZ6g+sOOp2n/VUmf0eZUWNnJ8i7AP +4Qif7aDKMcibOwSwsB+DKZXDvZ5XSdnMphtuLS5rPSL81rVRmWC2DMfQ2eP8j0WN +VTroSk0xedQ7Qr+9TNooi9IyzX6n1a2S1UiciEZ3ZcDbXPl/P01m+IYZyPnLv0+9 +ZeioZYh1JLv3/OKsMrMLTfh2ZCj3aXwmc2Owi/wU2LS5QUOMcHH7CQ== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/docker/php-apache/8.6/conf/etc/httpd/ssl/server.csr b/docker/php-apache/8.6/conf/etc/httpd/ssl/server.csr new file mode 100644 index 000000000..8a9909f77 --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/ssl/server.csr @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEcTCCAlkCAQAwLDEbMBkGA1UEChMSRG9ja2VyIEJvaWxlcnBsYXRlMQ0wCwYD +VQQDFAQqLnZtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAyt0yFIsg +713pVnmPVVzK6Y7mbWKVUg7AAi6YxVITJ7D+f4ik9FW3mcqh75sGYwIOBmNdHfsm +Q3YL/8XrtBzzhW7UeqQqddHdbXSx2baOQsrsbuyELAFY5w+iqO1xcLTZO/aOiWXw +BWhi+MOTKJK1ZgrbKZ7DGR+/+81OH/enGxd/cy6KZ6blxg+regwPEI94MtHbmk47 +ONm2ETfq8C81SgHr/fYkOJDzCZ+L1ev15Oq7aEswuuxkMlWWGhcqYnA9UjbbEZoB +Fb4wgQ26yzp3lIkcH3+qsRLGYux8b+wShY+IlFpyCOyv5z+0+rgR0IxzvhabBpFP +ZQjKwnlRQXvJCs/3G4Xfsi1MV8AD6+oEjj5sJ9t9hsuLaM76mR6W1MbIMe7E93o/ +SuuodQ+yfgYzRVmDNYW5wta+x/8UuxAcwVfKkaEAlXtPCbn+cbKLlxWpA3JS1ePi +/tXMZKcLAkA5cuYN7Zv0wagNjvmSfmB0AxypMzMoS7OotF/zOaryQYi4NRi0wktt +K6UOYF0xBriDah4MF0FpFDum4YEmKnRxl9822efqlqSOHrot3R2dS5dFR+iHKW+z +kU0MIXOlvCgZcm7LGD0pRjhARlI2BjYXqM/RaaEpMQorPj/GTSra5qT6KkrtHjjh +hThRxtNnjoD1cUsKw3jfTFSaOwT8rBjByZkCAwEAAaAAMA0GCSqGSIb3DQEBCwUA +A4ICAQBsEBgC2YepuZq/8UqvKMZKVy/etDKXj7BB+QPb+leNiKD7p4LDxHJsZSH8 +Ku9uMPeLfiQDn5jA41k5SlGttzvObd65RdEbO3yHpqsg05EGSDDLfaE1k2Al/qmX +/o8roPZF7+2kZthgMAgkcokS54LYqEYTGqOf3J9Ss0yRIZwhaOVebfFIbIOdpw0B +JNMIJPHTMdZrcuRVI+wR1uPLIlEJzBvxTGbTrvPU25WJFtu+EajKqXO0SHdy0yx8 +uH4ykRBJRc36+oYo7nZ5D56dh7pZn3+9J64FKAOV0Q3KqMFieGy053ezuhJd70eZ +UozTgfjs3WpMzoYmKETSyl3XZSdInRe+sUlKPruTsKyg69oYxjPlrGfAmmGcCFca +TnZinT18dI92zK7OtOVkmYeYKC1lwuhftVrNMXzZuHOGpS9NNYtc4nDqDMIEOfV3 +6rCdu03WjEgJ+Z67tJs16xOx9du4/EHxS2Ijn9DPfVJvYy0TgzDi1BUpjWx0KTLx +C4OQbEZ/QTWmHVbSch/hcZhzbf7SNh5RpnW4EtmcpDFjIKMfxJmoKeiTf7qnilx0 +7uRvsZFKoDKRDOFiPfgMg5AOtLHziYsd9m0tJjC2GHvFuPjzOtzhnUUjmmvht170 +2aqKakjST4amg7jzLcs871HX0/WjOtt29NpOz140blkKf1bisg== +-----END CERTIFICATE REQUEST----- \ No newline at end of file diff --git a/docker/php-apache/8.6/conf/etc/httpd/ssl/server.key b/docker/php-apache/8.6/conf/etc/httpd/ssl/server.key new file mode 100644 index 000000000..c9eec145f --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/ssl/server.key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAyt0yFIsg713pVnmPVVzK6Y7mbWKVUg7AAi6YxVITJ7D+f4ik +9FW3mcqh75sGYwIOBmNdHfsmQ3YL/8XrtBzzhW7UeqQqddHdbXSx2baOQsrsbuyE +LAFY5w+iqO1xcLTZO/aOiWXwBWhi+MOTKJK1ZgrbKZ7DGR+/+81OH/enGxd/cy6K +Z6blxg+regwPEI94MtHbmk47ONm2ETfq8C81SgHr/fYkOJDzCZ+L1ev15Oq7aEsw +uuxkMlWWGhcqYnA9UjbbEZoBFb4wgQ26yzp3lIkcH3+qsRLGYux8b+wShY+IlFpy +COyv5z+0+rgR0IxzvhabBpFPZQjKwnlRQXvJCs/3G4Xfsi1MV8AD6+oEjj5sJ9t9 +hsuLaM76mR6W1MbIMe7E93o/SuuodQ+yfgYzRVmDNYW5wta+x/8UuxAcwVfKkaEA +lXtPCbn+cbKLlxWpA3JS1ePi/tXMZKcLAkA5cuYN7Zv0wagNjvmSfmB0AxypMzMo +S7OotF/zOaryQYi4NRi0wkttK6UOYF0xBriDah4MF0FpFDum4YEmKnRxl9822efq +lqSOHrot3R2dS5dFR+iHKW+zkU0MIXOlvCgZcm7LGD0pRjhARlI2BjYXqM/RaaEp +MQorPj/GTSra5qT6KkrtHjjhhThRxtNnjoD1cUsKw3jfTFSaOwT8rBjByZkCAwEA +AQKCAgAbZPdoUsllyZbC+LNkYZ19ILD5QIDNjfRb1xMGQmkXyQz1B+zOmeyrNfPc +OWEJabOfJTfj3pByN7SzG3US4333HNpQnW6mbmqqZ0HFFqPrXR/Ecuf+UUhCG5hp +m3bgM2vKbyccYsmg0VHcKfzrU7RvTTP/UNMjx2fThwvvwS+ttuSdF0HVcXJB5sfP +OWWnZNhkdHZlRf81VCED/jsZqCZYEh5eMyj9AoXvXL4zayPPf+tC0DSKaXW2Xlxg +tZQhqup8+a9nlxZia0Z9hu8clo6jXkiP8FuKgfCMV0cOjiCKLLHS5svTbLLsVWwJ +F2ZAdVcD6mWQ43qHOEK5NEzGvQKO14CaOLnVT2yAkMcyNohsEgoDP9oCBGDJQbBH +NmtZfpVjjtuTr9P9TEkU1FcBRo0x6Il/DkzamGbOeFAmgnaGElhJ5c/CAG7whaIf +mUfFOBGPH/wESY3gBOACDofeSh27RrlvbLaPiCGKivDUTBmhBsIuso6XqOKbvtfV +/HhhndpdRVfIj4DdE7gIrLIGN977JMVAXFCNz7KrvAWwcOXrCHCoWpklJ9repq8l +26ICY8K7VXktzDHQUmhd88ZWR+9ASURsJghUgZUOcMrEGyvci6Y8hpLhHiNVPHuQ ++ps7tpPsXSntBUqWBzhRZh74+nJlOOV6oYykl30JT2JzB6lwiQKCAQEA9ecn8N2z +20tR2UEiTv/MjVSepQtAAajegvcd1iasvvQKXnh3XLmoZHzH2tTa0lp5RIZpUQPl +lOTwko0lYTBnYblt65AJQ3FTgisNobIpoqE8BFXLm6wggz7CbabjmPGDe173lPGR +sI0YSKYvzrdn4zw8Fh6WULJyZHLi58zJYL3r0WBDiOoxpGaGA1GlmkuIWjhKHaX2 +OvF1vOuQDJ2eDyTc5TYFC0NKG76Mvanov5L/yrhNM/umbmp0SPspzHGZobAKUr20 +OazFT8S+2TA1OTxWNbiPbSimFoaZbEdqsNACGfVJWO8Sh8iqlt5RmEcSiSvGBj6L +QKprRO9Fsp2GawKCAQEA0zGhRsnux4JTNsdUSYsEJtITMj6eE+nl7CoZ9DAOwC5X +6/aSpUE4TT+pWNrt9iluXiGL0j89UJ7r/L1OcsiyzGb8ig9NU4zr1NIGTZ0DstHi +HPYINjeiBJEFIy17kOQn+9/I5c4hBUwz6ihwNoEomymVB/EsLJKAML0AudJGKg+Z +/f/qrS40eab5SAiaKgsh0MZnj+vIxyGBydt6r2HGmjfNITVbXIu6IpO+6NXDwM/e +7v10AAZ3j9+gb1RedLg2ghuIuYU90hmMhtVWsh9nVmaOkMW9/WFgOPYvt/mHH/hR +d4pePZ9kACGmqo/b9sHvHw1YEubtCt1VUiNuFxnJCwKCAQBWnxz0vkRTJY8phsY9 +KeK2jm5sGTBs5T2syLwb6ffENFdKvAjgAw6Mh2And/+1ReWd+/MxdLv03UjZdxsJ +x3FDfXx5FH4O4ebW3a+pnAcKoN1xcX+N0O6LDRqUYcue3sTAOs3gC9CUbr91KAWD +Phw8ccWAzTmKJ7IgLFA982ekyoI9eTmRC159WRgwJxy844qerWF+XC4GyXP+HsTZ +jNRW5Vdi7sqMEyIR7+fIEAhLI88zbATWIPmZv6pC4ybwO7wwtsCMMQNBpdjDprzL +6S12ggikV+U+QKlxGe0FtYqhykRTPJKf32eZqVheWOZJTA/9fgv9ux52oxGycM8O +gmsNAoIBAQC60m5uZnd5uYnPLWkcXYNgq/kbO1UvHHut/FhVMKX7z4MrU0XKNfWO +MECoP5K9bU0aq+Y6KIMe7FapjvT0iSHRu1Cu+HZY8JI2A0xcIAeDijLRl7sP6wrB +q1+2DKgANjRAlWfsEfoX658JBpitPngjOheBnRCMpVQMyUT5HE/BKWf5zwdUB0mY +S+K8nA90HcDeJIS8RcGolbVwUV0oBABhr/cf50lYhqozqCr7YQ33ZGs7Uq3oz8+4 +UARmN2YPLl3Znm3GX12em8c6B0LX8vvA7Jw06Rf2Ksup1+3Ce1PTLiEy9A4FyRf3 +Hc2HmBbnJAtZlr5QikMqlzzAmmLqwH6dAoIBAC+ryaQGJFsijCSuaDfRp/uy9xnd +DjgMdTwjl5WLBmyudChVMANl8eqCbvVO41CN84yORk03oQ4cx0eKxAZaLaSzgkb3 +W0X2nFQe7VJSYMQswCQ+1WfJvEFrIdkEKIa//uQdhqNrgUKSNVhhSTMbNEkDTIWn +ssbv2H9hvUaFt/J/vP9zCKuU5oYvNU7Oi6ZXRYezRn9atlJYanLFoJnHUBRzGms5 +K0vhdCPDXQq87z5Yudoh0jLUQF9Nx0GTWeBceQ9n5hZeRUNQWxP4AJThQX9KSPTS +mbL3Kh4XNRmAUJ2N+Njh+3dg91s+JkKvC1wcspLsmLPQe+9AxBSH9y5JE/8= +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/docker/php-apache/8.6/conf/etc/httpd/vhost.common.conf b/docker/php-apache/8.6/conf/etc/httpd/vhost.common.conf new file mode 100644 index 000000000..384696b4e --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/vhost.common.conf @@ -0,0 +1,7 @@ +# compatibility for PHP and TYPO3 Docker Boilerplate + + Include /opt/docker/etc/httpd/vhost.common.d/*.conf + + = 2.4> + IncludeOptional /opt/docker/etc/httpd/vhost.common.d/*.conf + diff --git a/docker/php-apache/8.6/conf/etc/httpd/vhost.common.d/.gitkeep b/docker/php-apache/8.6/conf/etc/httpd/vhost.common.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-apache/8.6/conf/etc/httpd/vhost.common.d/01-boilerplate.conf b/docker/php-apache/8.6/conf/etc/httpd/vhost.common.d/01-boilerplate.conf new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/vhost.common.d/01-boilerplate.conf @@ -0,0 +1 @@ +# placeholder diff --git a/docker/php-apache/8.6/conf/etc/httpd/vhost.conf b/docker/php-apache/8.6/conf/etc/httpd/vhost.conf new file mode 100644 index 000000000..c04a94318 --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/vhost.conf @@ -0,0 +1,36 @@ +####################################### +# Vhost +####################################### + + + ServerName docker.vm + ServerAlias + DocumentRoot "" + + UseCanonicalName Off + + + Include /opt/docker/etc/httpd/vhost.common.d/*.conf + + = 2.4> + IncludeOptional /opt/docker/etc/httpd/vhost.common.d/*.conf + + + + + + ServerName docker.vm + ServerAlias + DocumentRoot "" + + UseCanonicalName Off + + + Include /opt/docker/etc/httpd/vhost.common.d/*.conf + + = 2.4> + IncludeOptional /opt/docker/etc/httpd/vhost.common.d/*.conf + + + Include /opt/docker/etc/httpd/vhost.ssl.conf + diff --git a/docker/php-apache/8.6/conf/etc/httpd/vhost.ssl.conf b/docker/php-apache/8.6/conf/etc/httpd/vhost.ssl.conf new file mode 100644 index 000000000..cf5fbc604 --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/httpd/vhost.ssl.conf @@ -0,0 +1,26 @@ + ############ + # SSL + ############ + + SSLEngine on + SSLCertificateFile /opt/docker/etc/httpd/ssl/server.crt + SSLCertificateKeyFile /opt/docker/etc/httpd/ssl/server.key + + + SSLOptions +StdEnvVars + + + SSLOptions +StdEnvVars + + + BrowserMatch "MSIE [2-6]" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + # MSIE 7 and newer should be able to use keepalive + # This regexp is ok with 17-9! + BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown + + ## SSL Hardening + SSLProtocol All -SSLv2 -SSLv3 + SSLHonorCipherOrder on + SSLCipherSuite 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA' diff --git a/docker/php-apache/8.6/conf/etc/supervisor.d/apache.conf b/docker/php-apache/8.6/conf/etc/supervisor.d/apache.conf new file mode 100644 index 000000000..12a6f86f7 --- /dev/null +++ b/docker/php-apache/8.6/conf/etc/supervisor.d/apache.conf @@ -0,0 +1,14 @@ +[group:apache] +programs=apached +priority=20 + +[program:apached] +command = /opt/docker/bin/service.d/httpd.sh +process_name=%(program_name)s +startsecs = 0 +autostart = true +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-apache/8.6/conf/provision/bootstrap.d/.gitkeep b/docker/php-apache/8.6/conf/provision/bootstrap.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-apache/8.6/conf/provision/bootstrap.d/10-apache.sh b/docker/php-apache/8.6/conf/provision/bootstrap.d/10-apache.sh new file mode 100644 index 000000000..e9feb08b4 --- /dev/null +++ b/docker/php-apache/8.6/conf/provision/bootstrap.d/10-apache.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) +IMAGE_DISTRIBUTION=$(docker-image-info dist) +IMAGE_DISTRIBUTION_VERSION=$(docker-image-info dist-version) +IMAGE_DISTRIBUTION_VERSION_MAIN=$(echo "$IMAGE_DISTRIBUTION_VERSION" | sed 's/^\([0-9]*\).*/\1/g') + +# Collect environment variables +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + APACHE_MAIN_PATH=/etc/apache2/ + APACHE_DOCKER_VHOST=/etc/apache2/sites-enabled/10-docker.conf + ;; + + RedHat) + APACHE_MAIN_PATH=/etc/httpd/ + APACHE_DOCKER_VHOST=/etc/httpd/conf.d/zzz-docker.conf + ;; + + Alpine) + APACHE_MAIN_PATH=/etc/apache2/ + APACHE_DOCKER_VHOST=/etc/apache2/conf.d/zzz-docker.conf + ;; +esac + +# Enable apache main config +ln -sf -- /opt/docker/etc/httpd/main.conf "$APACHE_DOCKER_VHOST" + +# Ensure /var/run/apache2 exists +mkdir -p -- "/var/run/apache2" + +if [[ "$IMAGE_FAMILY" == "Alpine" ]]; then + mkdir -p -- "/run/apache2" +fi + +# Maintain lock directory +if [[ "$IMAGE_FAMILY" == "Debian" ]]; then + mkdir -p -- "/var/lock/apache2" + chmod 0750 -- "/var/lock/apache2" + chown www-data:www-data -- "/var/lock/apache2" +fi + +APACHE_CONF_FILES=$(find "$APACHE_MAIN_PATH" -type f -iname '*.conf' -o -iname 'default*' -o -iname '*log') + +# Change log to Docker stdout +go-replace --regex --regex-backrefs \ + -s '^[\s]*(CustomLog|ErrorLog|TransferLog) ([^\s]+)(.*)' -r '$1 /docker.stdout $3' \ + -s '^[\s]*(ErrorLog) ([^\s]+)(.*)' -r '$1 /docker.stderr $3' \ + --path="$APACHE_MAIN_PATH" \ + --path-regex='(.*\.conf|default.*|.*log)$' + +# Switch MPM to event +if [[ "$IMAGE_FAMILY" == "RedHat" ]]; then + go-replace --mode=line --regex --regex-backrefs \ + -s '^[\s#]*(LoadModule mpm_prefork_module.*)' -r '#$1' \ + -s '^[\s#]*(LoadModule mpm_event_module.*)' -r '$1' \ + -- /etc/httpd/conf.modules.d/00-mpm.conf +fi + +if [[ "$IMAGE_DISTRIBUTION" == "Ubuntu" ]] && [[ "$IMAGE_DISTRIBUTION_VERSION_MAIN" -ge 14 ]]; then + a2enmod mpm_event +fi + +if [[ "$IMAGE_DISTRIBUTION" == "Debian" ]] && [[ "$IMAGE_DISTRIBUTION_VERSION_MAIN" -ge 8 ]]; then + a2enmod mpm_event +fi + +if [[ "$IMAGE_FAMILY" == "Alpine" ]]; then + go-replace --mode=line --regex --regex-backrefs \ + -s '^[\s#]*(LoadModule mpm_prefork_module.*)' -r '#$1' \ + -s '^[\s#]*(LoadModule mpm_event_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule deflate_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule rewrite_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule logio_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule slotmem_shm_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule actions_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule expires_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule ssl_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule socache_shmcb_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule proxy_ajp_module.*)' -r '#$1' \ + -s '^[\s#]*(LoadModule proxy_connect_module.*)' -r '#$1' \ + -s '^[\s#]*(LoadModule proxy_balancer_module.*)' -r '#$1' \ + -s '^[\s#]*(LoadModule proxy_express_module.*)' -r '#$1' \ + -s '^[\s#]*(LoadModule proxy_fcgi_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule proxy_fdpass_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule proxy_ftp_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule proxy_http_module.*)' -r '$1' \ + -s '^[\s#]*(LoadModule proxy_scgi_module.*)' -r '$1' \ + -- /etc/apache2/httpd.conf \ + /etc/apache2/conf.d/ssl.conf \ + /etc/apache2/conf.d/proxy.conf + + # Remove default vhost + sed -i -e '1h;2,$H;$!d;g' -e 's//#-> removed vhost/g' /etc/apache2/conf.d/ssl.conf +fi + +# Fix rights of ssl files +chown -R root:root /opt/docker/etc/httpd/ssl +find /opt/docker/etc/httpd/ssl -type d -exec chmod 750 {} \; +find /opt/docker/etc/httpd/ssl -type f -exec chmod 640 {} \; diff --git a/docker/php-apache/8.6/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache/8.6/conf/provision/bootstrap.d/10-php.sh new file mode 100644 index 000000000..c8669ca25 --- /dev/null +++ b/docker/php-apache/8.6/conf/provision/bootstrap.d/10-php.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Restrict php-fpm to local connection +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 127.0.0.1:9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' + diff --git a/docker/php-apache/8.6/conf/provision/entrypoint.d/.gitkeep b/docker/php-apache/8.6/conf/provision/entrypoint.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-apache/8.6/conf/provision/entrypoint.d/20-apache.sh b/docker/php-apache/8.6/conf/provision/entrypoint.d/20-apache.sh new file mode 100644 index 000000000..42ef48932 --- /dev/null +++ b/docker/php-apache/8.6/conf/provision/entrypoint.d/20-apache.sh @@ -0,0 +1,16 @@ +# Replace markers +go-replace \ + -s "" -r "$WEB_DOCUMENT_INDEX" \ + -s "" -r "$WEB_DOCUMENT_ROOT" \ + -s "" -r "$WEB_ALIAS_DOMAIN" \ + -s "" -r "$HOSTNAME" \ + -s "" -r "$WEB_PHP_SOCKET" \ + -s "" -r "$WEB_PHP_TIMEOUT" \ + --path=/opt/docker/etc/httpd/ \ + --path-pattern='*.conf' \ + --ignore-empty + +if [[ -z "$WEB_PHP_SOCKET" ]]; then + ## WEB_PHP_SOCKET is not set, remove PHP files + rm -f -- /opt/docker/etc/httpd/conf.d/10-php.conf +fi diff --git a/docker/php-dev/8.2/Dockerfile b/docker/php-dev/8.2/Dockerfile index d06537982..aacef8965 100644 --- a/docker/php-dev/8.2/Dockerfile +++ b/docker/php-dev/8.2/Dockerfile @@ -12,8 +12,9 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ diff --git a/docker/php-dev/8.3/Dockerfile b/docker/php-dev/8.3/Dockerfile index 19408ba53..06763ddda 100644 --- a/docker/php-dev/8.3/Dockerfile +++ b/docker/php-dev/8.3/Dockerfile @@ -12,8 +12,9 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ diff --git a/docker/php-dev/8.4/Dockerfile b/docker/php-dev/8.4/Dockerfile index f782ceb0b..4ade3f4e8 100644 --- a/docker/php-dev/8.4/Dockerfile +++ b/docker/php-dev/8.4/Dockerfile @@ -12,8 +12,9 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ diff --git a/docker/php-dev/8.5/Dockerfile b/docker/php-dev/8.5/Dockerfile index 9a130f462..f0618d86e 100644 --- a/docker/php-dev/8.5/Dockerfile +++ b/docker/php-dev/8.5/Dockerfile @@ -12,8 +12,9 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ diff --git a/docker/php-dev/8.6-alpine/Dockerfile b/docker/php-dev/8.6-alpine/Dockerfile new file mode 100644 index 000000000..2c45a6d67 --- /dev/null +++ b/docker/php-dev/8.6-alpine/Dockerfile @@ -0,0 +1,43 @@ +#+++++++++++++++++++++++++++++++++++++++ +# Dockerfile for webdevops/php-dev:8.6-alpine +# -- automatically generated -- +#+++++++++++++++++++++++++++++++++++++++ + +FROM webdevops/php:8.6-alpine + +COPY conf/ /opt/docker/ + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + # Install development environment + && bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ + # TODO PHP 8.6: `blackfire php:install` installs the glibc probe on Alpine with ZTS; + # install the Alpine probe directly + && mkdir -p /tmp/blackfire \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 "https://blackfire.io/api/v1/releases/probe/php/alpine/$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')/86-zts" | tar xz -C /tmp/blackfire \ + && mv /tmp/blackfire/blackfire-*.so "$(php -r 'echo ini_get("extension_dir");')/blackfire.so" \ + && printf '[blackfire]\nextension=blackfire.so\n' > /usr/local/etc/php/conf.d/99-blackfire.ini \ + && rm -rf /tmp/blackfire \ + && apk-install \ + linux-headers \ + make \ + autoconf \ + g++ \ + libtool \ + pkgconf \ + && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ + --skip-enable-extension --make-parallel-jobs="$(nproc)" "xdebug/xdebug:^3.6@alpha" \ + && rm -rf /tmp/pie \ + && apk del -f --purge \ + autoconf \ + linux-headers \ + g++ \ + make \ + libtool \ + pkgconf \ + && docker-php-ext-enable xdebug \ + # Enable php development services + && docker-service enable syslog \ + && docker-service enable postfix \ + && docker-service enable ssh \ + && docker-run-bootstrap diff --git a/docker/php-dev/8.6-alpine/Dockerfile.twig b/docker/php-dev/8.6-alpine/Dockerfile.twig new file mode 100644 index 000000000..1b0fd6812 --- /dev/null +++ b/docker/php-dev/8.6-alpine/Dockerfile.twig @@ -0,0 +1,11 @@ +{% import 'docker.twig' as docker %} +{% import 'provision.twig' as provision %} +{% import 'images/php.twig' as php %} +{{ docker.from("php", "8.6-alpine") }} + +{{ docker.copy('conf/', '/opt/docker/') }} + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + {{ php.officialDevelopmentAlpine(version="8.6") }} \ + {{ provision.runBootstrap() }} diff --git a/docker/php-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.d/10-init.sh b/docker/php-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.d/10-init.sh new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docker/php-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.d/10-init.sh @@ -0,0 +1 @@ +# placeholder diff --git a/docker/php-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.sh b/docker/php-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.sh new file mode 100644 index 000000000..95daa01ae --- /dev/null +++ b/docker/php-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_BLACKFIRE_AGENT_OPTS" ]]; then SERVICE_BLACKFIRE_AGENT_OPTS=""; fi + +source /opt/docker/bin/config.sh + +BLACKFIRE_ARGS="" + +includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" + +# blackfire.server_id +if [[ -n "${BLACKFIRE_SERVER_ID+x}" ]]; then + BLACKFIRE_ARGS="$BLACKFIRE_ARGS --server-id=\"${BLACKFIRE_SERVER_ID}\"" +fi + +# blackfire.server_token +if [[ -n "${BLACKFIRE_SERVER_TOKEN+x}" ]]; then + BLACKFIRE_ARGS="$BLACKFIRE_ARGS --server-token=\"${BLACKFIRE_SERVER_TOKEN}\"" +fi + +# create directory for unix socket +mkdir -p /var/run/blackfire + +eval exec blackfire-agent $BLACKFIRE_ARGS $SERVICE_BLACKFIRE_AGENT_OPTS diff --git a/docker/php-dev/8.6-alpine/conf/bin/service.d/ssh.d/99-development.sh b/docker/php-dev/8.6-alpine/conf/bin/service.d/ssh.d/99-development.sh new file mode 100644 index 000000000..2502ab3e3 --- /dev/null +++ b/docker/php-dev/8.6-alpine/conf/bin/service.d/ssh.d/99-development.sh @@ -0,0 +1,3 @@ + +# Allow root access via ssh +go-replace --mode=lineinfile -s 'PermitRootLogin' -r 'PermitRootLogin yes' -- /etc/ssh/sshd_config diff --git a/docker/php-dev/8.6-alpine/conf/etc/supervisor.d/blackfire-agent.conf b/docker/php-dev/8.6-alpine/conf/etc/supervisor.d/blackfire-agent.conf new file mode 100644 index 000000000..897831ddb --- /dev/null +++ b/docker/php-dev/8.6-alpine/conf/etc/supervisor.d/blackfire-agent.conf @@ -0,0 +1,14 @@ +[group:blackfire-agent] +programs=blackfire-agentd +priority=25 + +[program:blackfire-agentd] +command = /opt/docker/bin/service.d/blackfire-agent.sh +process_name=%(program_name)s +startsecs = 0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/10-php.sh new file mode 100644 index 000000000..d100a7e41 --- /dev/null +++ b/docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/10-php.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Configure php-fpm +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*access.format[\s]*=' -r 'access.format = "%R - %u %t \"%m %r%Q%q\" %s %f cpu:%C%% mem:%{megabytes}M reqTime:%d"' \ + -- /opt/docker/etc/php/fpm/pool.d/application.conf + +# Listen on port 9000 of all addresses: PHP-FPM binds to [::] (IPv6 and IPv4) +# and falls back to 0.0.0.0 if the container has no IPv6 +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' diff --git a/docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-opcache.sh b/docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-opcache.sh new file mode 100644 index 000000000..0bbb940b4 --- /dev/null +++ b/docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-opcache.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Configure opcache for development +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*opcache.memory_consumption[\s]*=' -r 'opcache.memory_consumption = 256' \ + -s '^[\s;]*opcache.validate_timestamps[\s]*=' -r 'opcache.validate_timestamps = 1' \ + -s '^[\s;]*opcache.revalidate_freq[\s]*=' -r 'opcache.revalidate_freq = 0' \ + -s '^[\s;]*opcache.interned_strings_buffer[\s]*=' -r 'opcache.interned_strings_buffer = 16' \ + -s '^[\s;]*opcache.max_accelerated_files[\s]*=' -r 'opcache.max_accelerated_files = 7963' \ + -- /opt/docker/etc/php/php.webdevops.ini diff --git a/docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-xdebug.sh b/docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-xdebug.sh new file mode 100644 index 000000000..63f5aeab9 --- /dev/null +++ b/docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-xdebug.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Configure xdebug for development +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*xdebug.mode[\s]*=' -r 'xdebug.mode = debug' \ + -s '^[\s;]*xdebug.discover_client_host[\s]*=' -r 'xdebug.discover_client_host = 1' \ + -s '^[\s;]*xdebug.idekey[\s]*=' -r 'xdebug.idekey = docker' \ + -s '^[\s;]*xdebug.cli_color[\s]*=' -r 'xdebug.cli_color = 1' \ + -s '^[\s;]*xdebug.max_nesting_level[\s]*=' -r 'xdebug.max_nesting_level = 1000' \ + -s '^[\s;]*xdebug.start_with_request[\s]*=' -r 'xdebug.start_with_request = trigger' \ + -s '^[\s;]*xdebug.output_dir[\s]*=' -r 'xdebug.output_dir = /tmp/debug' \ + -- /opt/docker/etc/php/php.webdevops.ini diff --git a/docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/99-development.sh b/docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/99-development.sh new file mode 100644 index 000000000..7fc8cca55 --- /dev/null +++ b/docker/php-dev/8.6-alpine/conf/provision/bootstrap.d/99-development.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Set passwords to "dev" +echo "$APPLICATION_USER":"dev" | chpasswd +echo "root":"dev" | chpasswd diff --git a/docker/php-dev/8.6-alpine/conf/provision/entrypoint.d/10-php-debugger.sh b/docker/php-dev/8.6-alpine/conf/provision/entrypoint.d/10-php-debugger.sh new file mode 100644 index 000000000..32f646e55 --- /dev/null +++ b/docker/php-dev/8.6-alpine/conf/provision/entrypoint.d/10-php-debugger.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash + +################################################# +# Debugger switch +################################################# + +PHP_CONF_PATHS="/usr/local/etc/php/conf.d/" + +function phpModuleRemove() { + if [ "$#" -ne 1 ]; then + echo "You must specify the name of the PHP module which you want to disable" + exit 1 + fi + + echo " - Removing PHP module ${1}" + for CONF_PATH in $PHP_CONF_PATHS; do + rm -f "${CONF_PATH}"/*"${1}".ini + done +} + + +if [[ -n "${PHP_DEBUGGER+x}" ]]; then + case "$PHP_DEBUGGER" in + xdebug) + echo "PHP-Debugger: Xdebug enabled" + phpModuleRemove "blackfire" + ;; + + blackfire) + echo "PHP-Debugger: Blackfire enabled" + phpModuleRemove "xdebug" + docker-service-enable blackfire-agent + ;; + + none) + echo "PHP-Debugger: none" + phpModuleRemove "blackfire" + phpModuleRemove "xdebug" + ;; + esac + +else + + echo "PHP-Debugger: not specified - default is xdebug" + phpModuleRemove "blackfire" + +fi + +################################################# +# PHP debugger environment variables +################################################# + +function phpEnvironmentVariable() { + PHP_INI_KEY="$1" + PHP_ENV_NAME="$2" + + if [[ -n "${!PHP_ENV_NAME+x}" ]]; then + PHP_ENV_VALUE="${!PHP_ENV_NAME}" + echo "${PHP_INI_KEY}=\"${PHP_ENV_VALUE}\"" >> /opt/docker/etc/php/php.ini + fi +} + +################### +# XDEBUG +################### + +# xdebug3 remote debugger +phpEnvironmentVariable "xdebug.discover_client_host" "XDEBUG_DISCOVER_CLIENT_HOST" +phpEnvironmentVariable "xdebug.mode" "XDEBUG_MODE" +phpEnvironmentVariable "xdebug.start_with_request" "XDEBUG_START_WITH_REQUEST" +phpEnvironmentVariable "xdebug.client_host" "XDEBUG_CLIENT_HOST" +phpEnvironmentVariable "xdebug.client_port" "XDEBUG_CLIENT_PORT" + +# xdebug3 profiler +phpEnvironmentVariable "xdebug.trigger_value" "XDEBUG_TRIGGER_VALUE" +phpEnvironmentVariable "xdebug.output_dir" "XDEBUG_OUTPUT_DIR" + +################### +# BLACKFIRE +################### +phpEnvironmentVariable "blackfire.server_id" "BLACKFIRE_SERVER_ID" +phpEnvironmentVariable "blackfire.server_token" "BLACKFIRE_SERVER_TOKEN" diff --git a/docker/php-dev/8.6/Dockerfile b/docker/php-dev/8.6/Dockerfile new file mode 100644 index 000000000..e16e060be --- /dev/null +++ b/docker/php-dev/8.6/Dockerfile @@ -0,0 +1,26 @@ +#+++++++++++++++++++++++++++++++++++++++ +# Dockerfile for webdevops/php-dev:8.6 +# -- automatically generated -- +#+++++++++++++++++++++++++++++++++++++++ + +FROM webdevops/php:8.6 + +COPY conf/ /opt/docker/ + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + # Install development environment + && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ + && blackfire php:install \ + # TODO PHP 8.6: Tideways is not installed yet, tideways-php 5.47.0 crashes + # PHP 8.6.0RC4 (ZTS) on startup + && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ + --skip-enable-extension --make-parallel-jobs="$(nproc)" "xdebug/xdebug:^3.6@alpha" \ + && rm -rf /tmp/pie \ + && docker-php-ext-enable xdebug \ + # Enable php development services + && docker-service enable syslog \ + && docker-service enable postfix \ + && docker-service enable ssh \ + && docker-run-bootstrap \ + && docker-image-cleanup diff --git a/docker/php-dev/8.6/Dockerfile.twig b/docker/php-dev/8.6/Dockerfile.twig new file mode 100644 index 000000000..f971ff814 --- /dev/null +++ b/docker/php-dev/8.6/Dockerfile.twig @@ -0,0 +1,12 @@ +{% import 'docker.twig' as docker %} +{% import 'provision.twig' as provision %} +{% import 'images/php.twig' as php %} +{{ docker.from("php", "8.6") }} + +{{ docker.copy('conf/', '/opt/docker/') }} + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + {{ php.officialDevelopment(version="8.6") }} \ + {{ provision.runBootstrap() }} \ + {{ docker.cleanup() }} diff --git a/docker/php-dev/8.6/conf/bin/service.d/blackfire-agent.d/10-init.sh b/docker/php-dev/8.6/conf/bin/service.d/blackfire-agent.d/10-init.sh new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docker/php-dev/8.6/conf/bin/service.d/blackfire-agent.d/10-init.sh @@ -0,0 +1 @@ +# placeholder diff --git a/docker/php-dev/8.6/conf/bin/service.d/blackfire-agent.sh b/docker/php-dev/8.6/conf/bin/service.d/blackfire-agent.sh new file mode 100644 index 000000000..95daa01ae --- /dev/null +++ b/docker/php-dev/8.6/conf/bin/service.d/blackfire-agent.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_BLACKFIRE_AGENT_OPTS" ]]; then SERVICE_BLACKFIRE_AGENT_OPTS=""; fi + +source /opt/docker/bin/config.sh + +BLACKFIRE_ARGS="" + +includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" + +# blackfire.server_id +if [[ -n "${BLACKFIRE_SERVER_ID+x}" ]]; then + BLACKFIRE_ARGS="$BLACKFIRE_ARGS --server-id=\"${BLACKFIRE_SERVER_ID}\"" +fi + +# blackfire.server_token +if [[ -n "${BLACKFIRE_SERVER_TOKEN+x}" ]]; then + BLACKFIRE_ARGS="$BLACKFIRE_ARGS --server-token=\"${BLACKFIRE_SERVER_TOKEN}\"" +fi + +# create directory for unix socket +mkdir -p /var/run/blackfire + +eval exec blackfire-agent $BLACKFIRE_ARGS $SERVICE_BLACKFIRE_AGENT_OPTS diff --git a/docker/php-dev/8.6/conf/bin/service.d/ssh.d/99-development.sh b/docker/php-dev/8.6/conf/bin/service.d/ssh.d/99-development.sh new file mode 100644 index 000000000..2502ab3e3 --- /dev/null +++ b/docker/php-dev/8.6/conf/bin/service.d/ssh.d/99-development.sh @@ -0,0 +1,3 @@ + +# Allow root access via ssh +go-replace --mode=lineinfile -s 'PermitRootLogin' -r 'PermitRootLogin yes' -- /etc/ssh/sshd_config diff --git a/docker/php-dev/8.6/conf/etc/supervisor.d/blackfire-agent.conf b/docker/php-dev/8.6/conf/etc/supervisor.d/blackfire-agent.conf new file mode 100644 index 000000000..897831ddb --- /dev/null +++ b/docker/php-dev/8.6/conf/etc/supervisor.d/blackfire-agent.conf @@ -0,0 +1,14 @@ +[group:blackfire-agent] +programs=blackfire-agentd +priority=25 + +[program:blackfire-agentd] +command = /opt/docker/bin/service.d/blackfire-agent.sh +process_name=%(program_name)s +startsecs = 0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-dev/8.6/conf/provision/bootstrap.d/10-php.sh b/docker/php-dev/8.6/conf/provision/bootstrap.d/10-php.sh new file mode 100644 index 000000000..d100a7e41 --- /dev/null +++ b/docker/php-dev/8.6/conf/provision/bootstrap.d/10-php.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Configure php-fpm +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*access.format[\s]*=' -r 'access.format = "%R - %u %t \"%m %r%Q%q\" %s %f cpu:%C%% mem:%{megabytes}M reqTime:%d"' \ + -- /opt/docker/etc/php/fpm/pool.d/application.conf + +# Listen on port 9000 of all addresses: PHP-FPM binds to [::] (IPv6 and IPv4) +# and falls back to 0.0.0.0 if the container has no IPv6 +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' diff --git a/docker/php-dev/8.6/conf/provision/bootstrap.d/20-php-module-opcache.sh b/docker/php-dev/8.6/conf/provision/bootstrap.d/20-php-module-opcache.sh new file mode 100644 index 000000000..0bbb940b4 --- /dev/null +++ b/docker/php-dev/8.6/conf/provision/bootstrap.d/20-php-module-opcache.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Configure opcache for development +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*opcache.memory_consumption[\s]*=' -r 'opcache.memory_consumption = 256' \ + -s '^[\s;]*opcache.validate_timestamps[\s]*=' -r 'opcache.validate_timestamps = 1' \ + -s '^[\s;]*opcache.revalidate_freq[\s]*=' -r 'opcache.revalidate_freq = 0' \ + -s '^[\s;]*opcache.interned_strings_buffer[\s]*=' -r 'opcache.interned_strings_buffer = 16' \ + -s '^[\s;]*opcache.max_accelerated_files[\s]*=' -r 'opcache.max_accelerated_files = 7963' \ + -- /opt/docker/etc/php/php.webdevops.ini diff --git a/docker/php-dev/8.6/conf/provision/bootstrap.d/20-php-module-xdebug.sh b/docker/php-dev/8.6/conf/provision/bootstrap.d/20-php-module-xdebug.sh new file mode 100644 index 000000000..63f5aeab9 --- /dev/null +++ b/docker/php-dev/8.6/conf/provision/bootstrap.d/20-php-module-xdebug.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Configure xdebug for development +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*xdebug.mode[\s]*=' -r 'xdebug.mode = debug' \ + -s '^[\s;]*xdebug.discover_client_host[\s]*=' -r 'xdebug.discover_client_host = 1' \ + -s '^[\s;]*xdebug.idekey[\s]*=' -r 'xdebug.idekey = docker' \ + -s '^[\s;]*xdebug.cli_color[\s]*=' -r 'xdebug.cli_color = 1' \ + -s '^[\s;]*xdebug.max_nesting_level[\s]*=' -r 'xdebug.max_nesting_level = 1000' \ + -s '^[\s;]*xdebug.start_with_request[\s]*=' -r 'xdebug.start_with_request = trigger' \ + -s '^[\s;]*xdebug.output_dir[\s]*=' -r 'xdebug.output_dir = /tmp/debug' \ + -- /opt/docker/etc/php/php.webdevops.ini diff --git a/docker/php-dev/8.6/conf/provision/bootstrap.d/99-development.sh b/docker/php-dev/8.6/conf/provision/bootstrap.d/99-development.sh new file mode 100644 index 000000000..7fc8cca55 --- /dev/null +++ b/docker/php-dev/8.6/conf/provision/bootstrap.d/99-development.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Set passwords to "dev" +echo "$APPLICATION_USER":"dev" | chpasswd +echo "root":"dev" | chpasswd diff --git a/docker/php-dev/8.6/conf/provision/entrypoint.d/10-php-debugger.sh b/docker/php-dev/8.6/conf/provision/entrypoint.d/10-php-debugger.sh new file mode 100644 index 000000000..32f646e55 --- /dev/null +++ b/docker/php-dev/8.6/conf/provision/entrypoint.d/10-php-debugger.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash + +################################################# +# Debugger switch +################################################# + +PHP_CONF_PATHS="/usr/local/etc/php/conf.d/" + +function phpModuleRemove() { + if [ "$#" -ne 1 ]; then + echo "You must specify the name of the PHP module which you want to disable" + exit 1 + fi + + echo " - Removing PHP module ${1}" + for CONF_PATH in $PHP_CONF_PATHS; do + rm -f "${CONF_PATH}"/*"${1}".ini + done +} + + +if [[ -n "${PHP_DEBUGGER+x}" ]]; then + case "$PHP_DEBUGGER" in + xdebug) + echo "PHP-Debugger: Xdebug enabled" + phpModuleRemove "blackfire" + ;; + + blackfire) + echo "PHP-Debugger: Blackfire enabled" + phpModuleRemove "xdebug" + docker-service-enable blackfire-agent + ;; + + none) + echo "PHP-Debugger: none" + phpModuleRemove "blackfire" + phpModuleRemove "xdebug" + ;; + esac + +else + + echo "PHP-Debugger: not specified - default is xdebug" + phpModuleRemove "blackfire" + +fi + +################################################# +# PHP debugger environment variables +################################################# + +function phpEnvironmentVariable() { + PHP_INI_KEY="$1" + PHP_ENV_NAME="$2" + + if [[ -n "${!PHP_ENV_NAME+x}" ]]; then + PHP_ENV_VALUE="${!PHP_ENV_NAME}" + echo "${PHP_INI_KEY}=\"${PHP_ENV_VALUE}\"" >> /opt/docker/etc/php/php.ini + fi +} + +################### +# XDEBUG +################### + +# xdebug3 remote debugger +phpEnvironmentVariable "xdebug.discover_client_host" "XDEBUG_DISCOVER_CLIENT_HOST" +phpEnvironmentVariable "xdebug.mode" "XDEBUG_MODE" +phpEnvironmentVariable "xdebug.start_with_request" "XDEBUG_START_WITH_REQUEST" +phpEnvironmentVariable "xdebug.client_host" "XDEBUG_CLIENT_HOST" +phpEnvironmentVariable "xdebug.client_port" "XDEBUG_CLIENT_PORT" + +# xdebug3 profiler +phpEnvironmentVariable "xdebug.trigger_value" "XDEBUG_TRIGGER_VALUE" +phpEnvironmentVariable "xdebug.output_dir" "XDEBUG_OUTPUT_DIR" + +################### +# BLACKFIRE +################### +phpEnvironmentVariable "blackfire.server_id" "BLACKFIRE_SERVER_ID" +phpEnvironmentVariable "blackfire.server_token" "BLACKFIRE_SERVER_TOKEN" diff --git a/docker/php-nginx-dev/8.2/Dockerfile b/docker/php-nginx-dev/8.2/Dockerfile index c660498e5..7a3a5ec0e 100644 --- a/docker/php-nginx-dev/8.2/Dockerfile +++ b/docker/php-nginx-dev/8.2/Dockerfile @@ -20,8 +20,9 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ diff --git a/docker/php-nginx-dev/8.3/Dockerfile b/docker/php-nginx-dev/8.3/Dockerfile index 4bf5bd2c2..595fb959d 100644 --- a/docker/php-nginx-dev/8.3/Dockerfile +++ b/docker/php-nginx-dev/8.3/Dockerfile @@ -20,8 +20,9 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ diff --git a/docker/php-nginx-dev/8.4/Dockerfile b/docker/php-nginx-dev/8.4/Dockerfile index 97a5ac67a..a5936e8a6 100644 --- a/docker/php-nginx-dev/8.4/Dockerfile +++ b/docker/php-nginx-dev/8.4/Dockerfile @@ -20,8 +20,9 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ diff --git a/docker/php-nginx-dev/8.5/Dockerfile b/docker/php-nginx-dev/8.5/Dockerfile index 58732f757..83a1e0bae 100644 --- a/docker/php-nginx-dev/8.5/Dockerfile +++ b/docker/php-nginx-dev/8.5/Dockerfile @@ -20,8 +20,9 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ diff --git a/docker/php-nginx-dev/8.6-alpine/Dockerfile b/docker/php-nginx-dev/8.6-alpine/Dockerfile new file mode 100644 index 000000000..5bed20c71 --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/Dockerfile @@ -0,0 +1,51 @@ +#+++++++++++++++++++++++++++++++++++++++ +# Dockerfile for webdevops/php-nginx-dev:8.6-alpine +# -- automatically generated -- +#+++++++++++++++++++++++++++++++++++++++ + +FROM webdevops/php-nginx:8.6-alpine + +ENV WEB_DOCUMENT_ROOT=/app \ + WEB_DOCUMENT_INDEX=index.php \ + WEB_ALIAS_DOMAIN=*.vm \ + WEB_PHP_TIMEOUT=600 \ + WEB_PHP_SOCKET="" +ENV WEB_PHP_SOCKET=127.0.0.1:9000 +ENV WEB_NO_CACHE_PATTERN="\.(css|js|gif|png|jpg|svg|json|xml)$" + +COPY conf/ /opt/docker/ + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + # Install development environment + && bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ + # TODO PHP 8.6: `blackfire php:install` installs the glibc probe on Alpine with ZTS; + # install the Alpine probe directly + && mkdir -p /tmp/blackfire \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 "https://blackfire.io/api/v1/releases/probe/php/alpine/$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')/86-zts" | tar xz -C /tmp/blackfire \ + && mv /tmp/blackfire/blackfire-*.so "$(php -r 'echo ini_get("extension_dir");')/blackfire.so" \ + && printf '[blackfire]\nextension=blackfire.so\n' > /usr/local/etc/php/conf.d/99-blackfire.ini \ + && rm -rf /tmp/blackfire \ + && apk-install \ + linux-headers \ + make \ + autoconf \ + g++ \ + libtool \ + pkgconf \ + && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ + --skip-enable-extension --make-parallel-jobs="$(nproc)" "xdebug/xdebug:^3.6@alpha" \ + && rm -rf /tmp/pie \ + && apk del -f --purge \ + autoconf \ + linux-headers \ + g++ \ + make \ + libtool \ + pkgconf \ + && docker-php-ext-enable xdebug \ + # Enable php development services + && docker-service enable syslog \ + && docker-service enable postfix \ + && docker-service enable ssh \ + && docker-run-bootstrap diff --git a/docker/php-nginx-dev/8.6-alpine/Dockerfile.twig b/docker/php-nginx-dev/8.6-alpine/Dockerfile.twig new file mode 100644 index 000000000..7b1a2449d --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/Dockerfile.twig @@ -0,0 +1,16 @@ +{% import 'docker.twig' as docker %} +{% import 'provision.twig' as provision %} +{% import 'environment.twig' as environment %} +{% import 'images/php.twig' as php %} +{{ docker.from("php-nginx", "8.6-alpine") }} + +{{ environment.web() }} +{{ environment.webPhp() }} +{{ environment.webDevelopment() }} + +{{ docker.copy('conf/', '/opt/docker/') }} + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + {{ php.officialDevelopmentAlpine(version="8.6") }} \ + {{ provision.runBootstrap() }} diff --git a/docker/php-nginx-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.d/10-init.sh b/docker/php-nginx-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.d/10-init.sh new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.d/10-init.sh @@ -0,0 +1 @@ +# placeholder diff --git a/docker/php-nginx-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.sh b/docker/php-nginx-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.sh new file mode 100644 index 000000000..95daa01ae --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/conf/bin/service.d/blackfire-agent.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_BLACKFIRE_AGENT_OPTS" ]]; then SERVICE_BLACKFIRE_AGENT_OPTS=""; fi + +source /opt/docker/bin/config.sh + +BLACKFIRE_ARGS="" + +includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" + +# blackfire.server_id +if [[ -n "${BLACKFIRE_SERVER_ID+x}" ]]; then + BLACKFIRE_ARGS="$BLACKFIRE_ARGS --server-id=\"${BLACKFIRE_SERVER_ID}\"" +fi + +# blackfire.server_token +if [[ -n "${BLACKFIRE_SERVER_TOKEN+x}" ]]; then + BLACKFIRE_ARGS="$BLACKFIRE_ARGS --server-token=\"${BLACKFIRE_SERVER_TOKEN}\"" +fi + +# create directory for unix socket +mkdir -p /var/run/blackfire + +eval exec blackfire-agent $BLACKFIRE_ARGS $SERVICE_BLACKFIRE_AGENT_OPTS diff --git a/docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/conf.d/02-dev.conf b/docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/conf.d/02-dev.conf new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/conf.d/02-dev.conf @@ -0,0 +1 @@ +# placeholder diff --git a/docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/vhost.common.d/.gitkeep b/docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/vhost.common.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/vhost.common.d/02-dev.conf b/docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/vhost.common.d/02-dev.conf new file mode 100644 index 000000000..4f80ec9d3 --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/vhost.common.d/02-dev.conf @@ -0,0 +1,6 @@ +location ~* { + expires off; + add_header Cache-Control private; + + try_files $uri $uri/ /?$query_string; +} diff --git a/docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/vhost.common.d/10-log.conf b/docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/vhost.common.d/10-log.conf new file mode 100644 index 000000000..a2cd929e7 --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/conf/etc/nginx/vhost.common.d/10-log.conf @@ -0,0 +1,2 @@ +access_log /docker.stdout; +error_log /docker.stderr info; diff --git a/docker/php-nginx-dev/8.6-alpine/conf/etc/supervisor.d/blackfire-agent.conf b/docker/php-nginx-dev/8.6-alpine/conf/etc/supervisor.d/blackfire-agent.conf new file mode 100644 index 000000000..897831ddb --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/conf/etc/supervisor.d/blackfire-agent.conf @@ -0,0 +1,14 @@ +[group:blackfire-agent] +programs=blackfire-agentd +priority=25 + +[program:blackfire-agentd] +command = /opt/docker/bin/service.d/blackfire-agent.sh +process_name=%(program_name)s +startsecs = 0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/.gitkeep b/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/10-nginx.sh b/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/10-nginx.sh new file mode 100644 index 000000000..b6100c8f1 --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/10-nginx.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Disable sendfile for nginx (eg. nfs usage) +go-replace --mode=lineinfile --regex \ + -s '^[\s#]*(sendfile)' -r 'sendfile off;' \ + -- /etc/nginx/nginx.conf diff --git a/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/10-php.sh new file mode 100644 index 000000000..d100a7e41 --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/10-php.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Configure php-fpm +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*access.format[\s]*=' -r 'access.format = "%R - %u %t \"%m %r%Q%q\" %s %f cpu:%C%% mem:%{megabytes}M reqTime:%d"' \ + -- /opt/docker/etc/php/fpm/pool.d/application.conf + +# Listen on port 9000 of all addresses: PHP-FPM binds to [::] (IPv6 and IPv4) +# and falls back to 0.0.0.0 if the container has no IPv6 +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' diff --git a/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-opcache.sh b/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-opcache.sh new file mode 100644 index 000000000..0bbb940b4 --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-opcache.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Configure opcache for development +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*opcache.memory_consumption[\s]*=' -r 'opcache.memory_consumption = 256' \ + -s '^[\s;]*opcache.validate_timestamps[\s]*=' -r 'opcache.validate_timestamps = 1' \ + -s '^[\s;]*opcache.revalidate_freq[\s]*=' -r 'opcache.revalidate_freq = 0' \ + -s '^[\s;]*opcache.interned_strings_buffer[\s]*=' -r 'opcache.interned_strings_buffer = 16' \ + -s '^[\s;]*opcache.max_accelerated_files[\s]*=' -r 'opcache.max_accelerated_files = 7963' \ + -- /opt/docker/etc/php/php.webdevops.ini diff --git a/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-xdebug.sh b/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-xdebug.sh new file mode 100644 index 000000000..63f5aeab9 --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/conf/provision/bootstrap.d/20-php-module-xdebug.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Configure xdebug for development +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*xdebug.mode[\s]*=' -r 'xdebug.mode = debug' \ + -s '^[\s;]*xdebug.discover_client_host[\s]*=' -r 'xdebug.discover_client_host = 1' \ + -s '^[\s;]*xdebug.idekey[\s]*=' -r 'xdebug.idekey = docker' \ + -s '^[\s;]*xdebug.cli_color[\s]*=' -r 'xdebug.cli_color = 1' \ + -s '^[\s;]*xdebug.max_nesting_level[\s]*=' -r 'xdebug.max_nesting_level = 1000' \ + -s '^[\s;]*xdebug.start_with_request[\s]*=' -r 'xdebug.start_with_request = trigger' \ + -s '^[\s;]*xdebug.output_dir[\s]*=' -r 'xdebug.output_dir = /tmp/debug' \ + -- /opt/docker/etc/php/php.webdevops.ini diff --git a/docker/php-nginx-dev/8.6-alpine/conf/provision/entrypoint.d/10-php-debugger.sh b/docker/php-nginx-dev/8.6-alpine/conf/provision/entrypoint.d/10-php-debugger.sh new file mode 100644 index 000000000..32f646e55 --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/conf/provision/entrypoint.d/10-php-debugger.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash + +################################################# +# Debugger switch +################################################# + +PHP_CONF_PATHS="/usr/local/etc/php/conf.d/" + +function phpModuleRemove() { + if [ "$#" -ne 1 ]; then + echo "You must specify the name of the PHP module which you want to disable" + exit 1 + fi + + echo " - Removing PHP module ${1}" + for CONF_PATH in $PHP_CONF_PATHS; do + rm -f "${CONF_PATH}"/*"${1}".ini + done +} + + +if [[ -n "${PHP_DEBUGGER+x}" ]]; then + case "$PHP_DEBUGGER" in + xdebug) + echo "PHP-Debugger: Xdebug enabled" + phpModuleRemove "blackfire" + ;; + + blackfire) + echo "PHP-Debugger: Blackfire enabled" + phpModuleRemove "xdebug" + docker-service-enable blackfire-agent + ;; + + none) + echo "PHP-Debugger: none" + phpModuleRemove "blackfire" + phpModuleRemove "xdebug" + ;; + esac + +else + + echo "PHP-Debugger: not specified - default is xdebug" + phpModuleRemove "blackfire" + +fi + +################################################# +# PHP debugger environment variables +################################################# + +function phpEnvironmentVariable() { + PHP_INI_KEY="$1" + PHP_ENV_NAME="$2" + + if [[ -n "${!PHP_ENV_NAME+x}" ]]; then + PHP_ENV_VALUE="${!PHP_ENV_NAME}" + echo "${PHP_INI_KEY}=\"${PHP_ENV_VALUE}\"" >> /opt/docker/etc/php/php.ini + fi +} + +################### +# XDEBUG +################### + +# xdebug3 remote debugger +phpEnvironmentVariable "xdebug.discover_client_host" "XDEBUG_DISCOVER_CLIENT_HOST" +phpEnvironmentVariable "xdebug.mode" "XDEBUG_MODE" +phpEnvironmentVariable "xdebug.start_with_request" "XDEBUG_START_WITH_REQUEST" +phpEnvironmentVariable "xdebug.client_host" "XDEBUG_CLIENT_HOST" +phpEnvironmentVariable "xdebug.client_port" "XDEBUG_CLIENT_PORT" + +# xdebug3 profiler +phpEnvironmentVariable "xdebug.trigger_value" "XDEBUG_TRIGGER_VALUE" +phpEnvironmentVariable "xdebug.output_dir" "XDEBUG_OUTPUT_DIR" + +################### +# BLACKFIRE +################### +phpEnvironmentVariable "blackfire.server_id" "BLACKFIRE_SERVER_ID" +phpEnvironmentVariable "blackfire.server_token" "BLACKFIRE_SERVER_TOKEN" diff --git a/docker/php-nginx-dev/8.6-alpine/conf/provision/entrypoint.d/20-nginx-dev.sh b/docker/php-nginx-dev/8.6-alpine/conf/provision/entrypoint.d/20-nginx-dev.sh new file mode 100644 index 000000000..f4695f059 --- /dev/null +++ b/docker/php-nginx-dev/8.6-alpine/conf/provision/entrypoint.d/20-nginx-dev.sh @@ -0,0 +1,7 @@ +go-replace \ + -s "" \ + -r "$WEB_NO_CACHE_PATTERN" \ + --path=/opt/docker/etc/nginx/ \ + --path-pattern='*.conf' \ + --ignore-empty + diff --git a/docker/php-nginx-dev/8.6/Dockerfile b/docker/php-nginx-dev/8.6/Dockerfile new file mode 100644 index 000000000..4a04af99f --- /dev/null +++ b/docker/php-nginx-dev/8.6/Dockerfile @@ -0,0 +1,34 @@ +#+++++++++++++++++++++++++++++++++++++++ +# Dockerfile for webdevops/php-nginx-dev:8.6 +# -- automatically generated -- +#+++++++++++++++++++++++++++++++++++++++ + +FROM webdevops/php-nginx:8.6 + +ENV WEB_DOCUMENT_ROOT=/app \ + WEB_DOCUMENT_INDEX=index.php \ + WEB_ALIAS_DOMAIN=*.vm \ + WEB_PHP_TIMEOUT=600 \ + WEB_PHP_SOCKET="" +ENV WEB_PHP_SOCKET=127.0.0.1:9000 +ENV WEB_NO_CACHE_PATTERN="\.(css|js|gif|png|jpg|svg|json|xml)$" + +COPY conf/ /opt/docker/ + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + # Install development environment + && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ + && blackfire php:install \ + # TODO PHP 8.6: Tideways is not installed yet, tideways-php 5.47.0 crashes + # PHP 8.6.0RC4 (ZTS) on startup + && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ + --skip-enable-extension --make-parallel-jobs="$(nproc)" "xdebug/xdebug:^3.6@alpha" \ + && rm -rf /tmp/pie \ + && docker-php-ext-enable xdebug \ + # Enable php development services + && docker-service enable syslog \ + && docker-service enable postfix \ + && docker-service enable ssh \ + && docker-run-bootstrap \ + && docker-image-cleanup diff --git a/docker/php-nginx-dev/8.6/Dockerfile.twig b/docker/php-nginx-dev/8.6/Dockerfile.twig new file mode 100644 index 000000000..2e2bb2114 --- /dev/null +++ b/docker/php-nginx-dev/8.6/Dockerfile.twig @@ -0,0 +1,17 @@ +{% import 'docker.twig' as docker %} +{% import 'provision.twig' as provision %} +{% import 'environment.twig' as environment %} +{% import 'images/php.twig' as php %} +{{ docker.from("php-nginx", "8.6") }} + +{{ environment.web() }} +{{ environment.webPhp() }} +{{ environment.webDevelopment() }} + +{{ docker.copy('conf/', '/opt/docker/') }} + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + {{ php.officialDevelopment(version="8.6") }} \ + {{ provision.runBootstrap() }} \ + {{ docker.cleanup() }} diff --git a/docker/php-nginx-dev/8.6/conf/bin/service.d/blackfire-agent.d/10-init.sh b/docker/php-nginx-dev/8.6/conf/bin/service.d/blackfire-agent.d/10-init.sh new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docker/php-nginx-dev/8.6/conf/bin/service.d/blackfire-agent.d/10-init.sh @@ -0,0 +1 @@ +# placeholder diff --git a/docker/php-nginx-dev/8.6/conf/bin/service.d/blackfire-agent.sh b/docker/php-nginx-dev/8.6/conf/bin/service.d/blackfire-agent.sh new file mode 100644 index 000000000..95daa01ae --- /dev/null +++ b/docker/php-nginx-dev/8.6/conf/bin/service.d/blackfire-agent.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_BLACKFIRE_AGENT_OPTS" ]]; then SERVICE_BLACKFIRE_AGENT_OPTS=""; fi + +source /opt/docker/bin/config.sh + +BLACKFIRE_ARGS="" + +includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" + +# blackfire.server_id +if [[ -n "${BLACKFIRE_SERVER_ID+x}" ]]; then + BLACKFIRE_ARGS="$BLACKFIRE_ARGS --server-id=\"${BLACKFIRE_SERVER_ID}\"" +fi + +# blackfire.server_token +if [[ -n "${BLACKFIRE_SERVER_TOKEN+x}" ]]; then + BLACKFIRE_ARGS="$BLACKFIRE_ARGS --server-token=\"${BLACKFIRE_SERVER_TOKEN}\"" +fi + +# create directory for unix socket +mkdir -p /var/run/blackfire + +eval exec blackfire-agent $BLACKFIRE_ARGS $SERVICE_BLACKFIRE_AGENT_OPTS diff --git a/docker/php-nginx-dev/8.6/conf/etc/nginx/conf.d/02-dev.conf b/docker/php-nginx-dev/8.6/conf/etc/nginx/conf.d/02-dev.conf new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docker/php-nginx-dev/8.6/conf/etc/nginx/conf.d/02-dev.conf @@ -0,0 +1 @@ +# placeholder diff --git a/docker/php-nginx-dev/8.6/conf/etc/nginx/vhost.common.d/.gitkeep b/docker/php-nginx-dev/8.6/conf/etc/nginx/vhost.common.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-nginx-dev/8.6/conf/etc/nginx/vhost.common.d/02-dev.conf b/docker/php-nginx-dev/8.6/conf/etc/nginx/vhost.common.d/02-dev.conf new file mode 100644 index 000000000..4f80ec9d3 --- /dev/null +++ b/docker/php-nginx-dev/8.6/conf/etc/nginx/vhost.common.d/02-dev.conf @@ -0,0 +1,6 @@ +location ~* { + expires off; + add_header Cache-Control private; + + try_files $uri $uri/ /?$query_string; +} diff --git a/docker/php-nginx-dev/8.6/conf/etc/nginx/vhost.common.d/10-log.conf b/docker/php-nginx-dev/8.6/conf/etc/nginx/vhost.common.d/10-log.conf new file mode 100644 index 000000000..a2cd929e7 --- /dev/null +++ b/docker/php-nginx-dev/8.6/conf/etc/nginx/vhost.common.d/10-log.conf @@ -0,0 +1,2 @@ +access_log /docker.stdout; +error_log /docker.stderr info; diff --git a/docker/php-nginx-dev/8.6/conf/etc/supervisor.d/blackfire-agent.conf b/docker/php-nginx-dev/8.6/conf/etc/supervisor.d/blackfire-agent.conf new file mode 100644 index 000000000..897831ddb --- /dev/null +++ b/docker/php-nginx-dev/8.6/conf/etc/supervisor.d/blackfire-agent.conf @@ -0,0 +1,14 @@ +[group:blackfire-agent] +programs=blackfire-agentd +priority=25 + +[program:blackfire-agentd] +command = /opt/docker/bin/service.d/blackfire-agent.sh +process_name=%(program_name)s +startsecs = 0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/.gitkeep b/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/10-nginx.sh b/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/10-nginx.sh new file mode 100644 index 000000000..b6100c8f1 --- /dev/null +++ b/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/10-nginx.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# Disable sendfile for nginx (eg. nfs usage) +go-replace --mode=lineinfile --regex \ + -s '^[\s#]*(sendfile)' -r 'sendfile off;' \ + -- /etc/nginx/nginx.conf diff --git a/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/10-php.sh new file mode 100644 index 000000000..d100a7e41 --- /dev/null +++ b/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/10-php.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Configure php-fpm +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*access.format[\s]*=' -r 'access.format = "%R - %u %t \"%m %r%Q%q\" %s %f cpu:%C%% mem:%{megabytes}M reqTime:%d"' \ + -- /opt/docker/etc/php/fpm/pool.d/application.conf + +# Listen on port 9000 of all addresses: PHP-FPM binds to [::] (IPv6 and IPv4) +# and falls back to 0.0.0.0 if the container has no IPv6 +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' diff --git a/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/20-php-module-opcache.sh b/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/20-php-module-opcache.sh new file mode 100644 index 000000000..0bbb940b4 --- /dev/null +++ b/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/20-php-module-opcache.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Configure opcache for development +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*opcache.memory_consumption[\s]*=' -r 'opcache.memory_consumption = 256' \ + -s '^[\s;]*opcache.validate_timestamps[\s]*=' -r 'opcache.validate_timestamps = 1' \ + -s '^[\s;]*opcache.revalidate_freq[\s]*=' -r 'opcache.revalidate_freq = 0' \ + -s '^[\s;]*opcache.interned_strings_buffer[\s]*=' -r 'opcache.interned_strings_buffer = 16' \ + -s '^[\s;]*opcache.max_accelerated_files[\s]*=' -r 'opcache.max_accelerated_files = 7963' \ + -- /opt/docker/etc/php/php.webdevops.ini diff --git a/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/20-php-module-xdebug.sh b/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/20-php-module-xdebug.sh new file mode 100644 index 000000000..63f5aeab9 --- /dev/null +++ b/docker/php-nginx-dev/8.6/conf/provision/bootstrap.d/20-php-module-xdebug.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Configure xdebug for development +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*xdebug.mode[\s]*=' -r 'xdebug.mode = debug' \ + -s '^[\s;]*xdebug.discover_client_host[\s]*=' -r 'xdebug.discover_client_host = 1' \ + -s '^[\s;]*xdebug.idekey[\s]*=' -r 'xdebug.idekey = docker' \ + -s '^[\s;]*xdebug.cli_color[\s]*=' -r 'xdebug.cli_color = 1' \ + -s '^[\s;]*xdebug.max_nesting_level[\s]*=' -r 'xdebug.max_nesting_level = 1000' \ + -s '^[\s;]*xdebug.start_with_request[\s]*=' -r 'xdebug.start_with_request = trigger' \ + -s '^[\s;]*xdebug.output_dir[\s]*=' -r 'xdebug.output_dir = /tmp/debug' \ + -- /opt/docker/etc/php/php.webdevops.ini diff --git a/docker/php-nginx-dev/8.6/conf/provision/entrypoint.d/10-php-debugger.sh b/docker/php-nginx-dev/8.6/conf/provision/entrypoint.d/10-php-debugger.sh new file mode 100644 index 000000000..32f646e55 --- /dev/null +++ b/docker/php-nginx-dev/8.6/conf/provision/entrypoint.d/10-php-debugger.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash + +################################################# +# Debugger switch +################################################# + +PHP_CONF_PATHS="/usr/local/etc/php/conf.d/" + +function phpModuleRemove() { + if [ "$#" -ne 1 ]; then + echo "You must specify the name of the PHP module which you want to disable" + exit 1 + fi + + echo " - Removing PHP module ${1}" + for CONF_PATH in $PHP_CONF_PATHS; do + rm -f "${CONF_PATH}"/*"${1}".ini + done +} + + +if [[ -n "${PHP_DEBUGGER+x}" ]]; then + case "$PHP_DEBUGGER" in + xdebug) + echo "PHP-Debugger: Xdebug enabled" + phpModuleRemove "blackfire" + ;; + + blackfire) + echo "PHP-Debugger: Blackfire enabled" + phpModuleRemove "xdebug" + docker-service-enable blackfire-agent + ;; + + none) + echo "PHP-Debugger: none" + phpModuleRemove "blackfire" + phpModuleRemove "xdebug" + ;; + esac + +else + + echo "PHP-Debugger: not specified - default is xdebug" + phpModuleRemove "blackfire" + +fi + +################################################# +# PHP debugger environment variables +################################################# + +function phpEnvironmentVariable() { + PHP_INI_KEY="$1" + PHP_ENV_NAME="$2" + + if [[ -n "${!PHP_ENV_NAME+x}" ]]; then + PHP_ENV_VALUE="${!PHP_ENV_NAME}" + echo "${PHP_INI_KEY}=\"${PHP_ENV_VALUE}\"" >> /opt/docker/etc/php/php.ini + fi +} + +################### +# XDEBUG +################### + +# xdebug3 remote debugger +phpEnvironmentVariable "xdebug.discover_client_host" "XDEBUG_DISCOVER_CLIENT_HOST" +phpEnvironmentVariable "xdebug.mode" "XDEBUG_MODE" +phpEnvironmentVariable "xdebug.start_with_request" "XDEBUG_START_WITH_REQUEST" +phpEnvironmentVariable "xdebug.client_host" "XDEBUG_CLIENT_HOST" +phpEnvironmentVariable "xdebug.client_port" "XDEBUG_CLIENT_PORT" + +# xdebug3 profiler +phpEnvironmentVariable "xdebug.trigger_value" "XDEBUG_TRIGGER_VALUE" +phpEnvironmentVariable "xdebug.output_dir" "XDEBUG_OUTPUT_DIR" + +################### +# BLACKFIRE +################### +phpEnvironmentVariable "blackfire.server_id" "BLACKFIRE_SERVER_ID" +phpEnvironmentVariable "blackfire.server_token" "BLACKFIRE_SERVER_TOKEN" diff --git a/docker/php-nginx-dev/8.6/conf/provision/entrypoint.d/20-nginx-dev.sh b/docker/php-nginx-dev/8.6/conf/provision/entrypoint.d/20-nginx-dev.sh new file mode 100644 index 000000000..f4695f059 --- /dev/null +++ b/docker/php-nginx-dev/8.6/conf/provision/entrypoint.d/20-nginx-dev.sh @@ -0,0 +1,7 @@ +go-replace \ + -s "" \ + -r "$WEB_NO_CACHE_PATTERN" \ + --path=/opt/docker/etc/nginx/ \ + --path-pattern='*.conf' \ + --ignore-empty + diff --git a/docker/php-nginx/8.2/Dockerfile b/docker/php-nginx/8.2/Dockerfile index 0253c73ef..aa1050595 100644 --- a/docker/php-nginx/8.2/Dockerfile +++ b/docker/php-nginx/8.2/Dockerfile @@ -17,9 +17,10 @@ COPY conf/ /opt/docker/ RUN set -x \ # Install nginx - && printf "deb http://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx\n deb-src http://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx" \ - >> /etc/apt/sources.list \ - && curl -L https://nginx.org/keys/nginx_signing.key | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://nginx.org/keys/nginx_signing.key -o /etc/apt/keyrings/nginx.asc \ + && printf "deb [signed-by=/etc/apt/keyrings/nginx.asc] https://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx\n" \ + > /etc/apt/sources.list.d/nginx.list \ && apt-install \ nginx \ && docker-run-bootstrap \ diff --git a/docker/php-nginx/8.3/Dockerfile b/docker/php-nginx/8.3/Dockerfile index 035035f8d..e239523ee 100644 --- a/docker/php-nginx/8.3/Dockerfile +++ b/docker/php-nginx/8.3/Dockerfile @@ -17,9 +17,10 @@ COPY conf/ /opt/docker/ RUN set -x \ # Install nginx - && printf "deb http://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx\n deb-src http://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx" \ - >> /etc/apt/sources.list \ - && curl -L https://nginx.org/keys/nginx_signing.key | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://nginx.org/keys/nginx_signing.key -o /etc/apt/keyrings/nginx.asc \ + && printf "deb [signed-by=/etc/apt/keyrings/nginx.asc] https://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx\n" \ + > /etc/apt/sources.list.d/nginx.list \ && apt-install \ nginx \ && docker-run-bootstrap \ diff --git a/docker/php-nginx/8.4/Dockerfile b/docker/php-nginx/8.4/Dockerfile index 7b37e5d81..2b63c1675 100644 --- a/docker/php-nginx/8.4/Dockerfile +++ b/docker/php-nginx/8.4/Dockerfile @@ -17,9 +17,10 @@ COPY conf/ /opt/docker/ RUN set -x \ # Install nginx - && printf "deb http://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx\n deb-src http://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx" \ - >> /etc/apt/sources.list \ - && curl -L https://nginx.org/keys/nginx_signing.key | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://nginx.org/keys/nginx_signing.key -o /etc/apt/keyrings/nginx.asc \ + && printf "deb [signed-by=/etc/apt/keyrings/nginx.asc] https://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx\n" \ + > /etc/apt/sources.list.d/nginx.list \ && apt-install \ nginx \ && docker-run-bootstrap \ diff --git a/docker/php-nginx/8.5/Dockerfile b/docker/php-nginx/8.5/Dockerfile index 10fd51d04..bb02fa1ed 100644 --- a/docker/php-nginx/8.5/Dockerfile +++ b/docker/php-nginx/8.5/Dockerfile @@ -17,9 +17,10 @@ COPY conf/ /opt/docker/ RUN set -x \ # Install nginx - && printf "deb http://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx\n deb-src http://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx" \ - >> /etc/apt/sources.list \ - && curl -L https://nginx.org/keys/nginx_signing.key | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://nginx.org/keys/nginx_signing.key -o /etc/apt/keyrings/nginx.asc \ + && printf "deb [signed-by=/etc/apt/keyrings/nginx.asc] https://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx\n" \ + > /etc/apt/sources.list.d/nginx.list \ && apt-install \ nginx \ && docker-run-bootstrap \ diff --git a/docker/php-nginx/8.6-alpine/Dockerfile b/docker/php-nginx/8.6-alpine/Dockerfile new file mode 100644 index 000000000..7832e59dc --- /dev/null +++ b/docker/php-nginx/8.6-alpine/Dockerfile @@ -0,0 +1,24 @@ +#+++++++++++++++++++++++++++++++++++++++ +# Dockerfile for webdevops/php-nginx:8.6-alpine +# -- automatically generated -- +#+++++++++++++++++++++++++++++++++++++++ + +FROM webdevops/php:8.6-alpine + +ENV WEB_DOCUMENT_ROOT=/app \ + WEB_DOCUMENT_INDEX=index.php \ + WEB_ALIAS_DOMAIN=*.vm \ + WEB_PHP_TIMEOUT=600 \ + WEB_PHP_SOCKET="" +ENV WEB_PHP_SOCKET=127.0.0.1:9000 +ENV SERVICE_NGINX_CLIENT_MAX_BODY_SIZE="50m" + +COPY conf/ /opt/docker/ + +RUN set -x \ + # Install nginx + && apk-install \ + nginx \ + && docker-run-bootstrap + +EXPOSE 80 443 diff --git a/docker/php-nginx/8.6-alpine/Dockerfile.twig b/docker/php-nginx/8.6-alpine/Dockerfile.twig new file mode 100644 index 000000000..ad1c71eb4 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/Dockerfile.twig @@ -0,0 +1,17 @@ +{% import 'docker.twig' as docker %} +{% import 'provision.twig' as provision %} +{% import 'environment.twig' as environment %} +{% import 'images/nginx.twig' as nginx %} +{{ docker.from("php", "8.6-alpine") }} + +{{ environment.web() }} +{{ environment.webPhp() }} +{{ environment.nginx() }} + +{{ docker.copy('conf/', '/opt/docker/') }} + +RUN set -x \ + {{ nginx.alpine() }} \ + {{ provision.runBootstrap() }} + +{{ docker.expose('80 443') }} diff --git a/docker/php-nginx/8.6-alpine/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/8.6-alpine/conf/bin/service.d/nginx.d/10-init.sh new file mode 100644 index 000000000..8acb5111d --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/bin/service.d/nginx.d/10-init.sh @@ -0,0 +1,5 @@ +if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then + echo "" + echo "[WARNING] WEB_DOCUMENT_ROOT does not exists with path \"$WEB_DOCUMENT_ROOT\"!" + echo "" +fi diff --git a/docker/php-nginx/8.6-alpine/conf/bin/service.d/nginx.sh b/docker/php-nginx/8.6-alpine/conf/bin/service.d/nginx.sh new file mode 100644 index 000000000..3517c72a5 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/bin/service.d/nginx.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_NGINX_OPTS" ]]; then SERVICE_NGINX_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/nginx.d/" + +exec /usr/sbin/nginx -g 'daemon off;' $SERVICE_NGINX_OPTS diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/conf.d/.gitkeep b/docker/php-nginx/8.6-alpine/conf/etc/nginx/conf.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/conf.d/10-php.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/conf.d/10-php.conf new file mode 100644 index 000000000..9abe45f0a --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/conf.d/10-php.conf @@ -0,0 +1,3 @@ +upstream php { + server ; +} diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/global.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/global.conf new file mode 100644 index 000000000..b6141db09 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/global.conf @@ -0,0 +1 @@ +# deprecated diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/main.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/main.conf new file mode 100644 index 000000000..06de0651b --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/main.conf @@ -0,0 +1,4 @@ +include /opt/docker/etc/nginx/global.conf; +include /opt/docker/etc/nginx/php.conf; +include /opt/docker/etc/nginx/conf.d/*.conf; +include /opt/docker/etc/nginx/vhost.conf; diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/nginx.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/nginx.conf new file mode 100644 index 000000000..b9cb4ebc4 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/nginx.conf @@ -0,0 +1,34 @@ +# For more information on configuration, see: +# * Official English Documentation: http://nginx.org/en/docs/ +# * Official Russian Documentation: http://nginx.org/ru/docs/ + +user nginx; +worker_processes auto; +error_log /docker.stdout; +pid /run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /docker.stdout main; + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + # Load modular configuration files from the /etc/nginx/conf.d directory. + # See http://nginx.org/en/docs/ngx_core_module.html#include + # for more information. + include /etc/nginx/conf.d/*.conf; +} diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/php.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/php.conf new file mode 100644 index 000000000..b6141db09 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/php.conf @@ -0,0 +1 @@ +# deprecated diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/ssl/server.crt b/docker/php-nginx/8.6-alpine/conf/etc/nginx/ssl/server.crt new file mode 100644 index 000000000..6b0694907 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/ssl/server.crt @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIE1DCCArwCCQDMMwGnSuK0tTANBgkqhkiG9w0BAQsFADAsMRswGQYDVQQKExJE +b2NrZXIgQm9pbGVycGxhdGUxDTALBgNVBAMUBCoudm0wHhcNMTUwNTA0MTcxNDQw +WhcNMjUwNTAxMTcxNDQwWjAsMRswGQYDVQQKExJEb2NrZXIgQm9pbGVycGxhdGUx +DTALBgNVBAMUBCoudm0wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDK +3TIUiyDvXelWeY9VXMrpjuZtYpVSDsACLpjFUhMnsP5/iKT0VbeZyqHvmwZjAg4G +Y10d+yZDdgv/xeu0HPOFbtR6pCp10d1tdLHZto5Cyuxu7IQsAVjnD6Ko7XFwtNk7 +9o6JZfAFaGL4w5MokrVmCtspnsMZH7/7zU4f96cbF39zLopnpuXGD6t6DA8Qj3gy +0duaTjs42bYRN+rwLzVKAev99iQ4kPMJn4vV6/Xk6rtoSzC67GQyVZYaFypicD1S +NtsRmgEVvjCBDbrLOneUiRwff6qxEsZi7Hxv7BKFj4iUWnII7K/nP7T6uBHQjHO+ +FpsGkU9lCMrCeVFBe8kKz/cbhd+yLUxXwAPr6gSOPmwn232Gy4tozvqZHpbUxsgx +7sT3ej9K66h1D7J+BjNFWYM1hbnC1r7H/xS7EBzBV8qRoQCVe08Juf5xsouXFakD +clLV4+L+1cxkpwsCQDly5g3tm/TBqA2O+ZJ+YHQDHKkzMyhLs6i0X/M5qvJBiLg1 +GLTCS20rpQ5gXTEGuINqHgwXQWkUO6bhgSYqdHGX3zbZ5+qWpI4eui3dHZ1Ll0VH +6Icpb7ORTQwhc6W8KBlybssYPSlGOEBGUjYGNheoz9FpoSkxCis+P8ZNKtrmpPoq +Su0eOOGFOFHG02eOgPVxSwrDeN9MVJo7BPysGMHJmQIDAQABMA0GCSqGSIb3DQEB +CwUAA4ICAQC63g6NHmQKbiy3G6iaDkpUSbr5Mq2YgU61XnvWVyREqDcy/BXCw9oY +SJ/KUvCpqPnACNOFqjadRAmPiA9nf2WduoCgwQGV/YRFGswSuVvh/3X2TX5NWvbS +t8MQDttQg1dxpiMUjlu3rqhfohBdWJvp2lVSdpDb/MOlXBc/+p7HfOHwhqB7wwPN +NNbSKUbZqZxmD8cOf1X0hASr1yfFPj+2vST3ESaON8S0T2p63YX/sD5jvOUiEuyw +I5WcvLmiRZA07SH8nWyckLY3qWL+OlhSZrlAnolWS00b+7h5LNuRYEjKzwVgntoA +aCopyQih6wIk0+AfJO4sfhJBmQhnIrAaP/zwBH5g9zVizLf5H7U+hNXrMwgw55Sq +vjMdkZHvPKUXTvVit/rYE9H+PY3brkRWzOl4V/i/ZLJJm5805H/NyTbz9kPMJw2Q +nn+KOpfXXySD39f8iuRgSKXsYNul38hxWgcZZ6g+sOOp2n/VUmf0eZUWNnJ8i7AP +4Qif7aDKMcibOwSwsB+DKZXDvZ5XSdnMphtuLS5rPSL81rVRmWC2DMfQ2eP8j0WN +VTroSk0xedQ7Qr+9TNooi9IyzX6n1a2S1UiciEZ3ZcDbXPl/P01m+IYZyPnLv0+9 +ZeioZYh1JLv3/OKsMrMLTfh2ZCj3aXwmc2Owi/wU2LS5QUOMcHH7CQ== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/ssl/server.csr b/docker/php-nginx/8.6-alpine/conf/etc/nginx/ssl/server.csr new file mode 100644 index 000000000..8a9909f77 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/ssl/server.csr @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEcTCCAlkCAQAwLDEbMBkGA1UEChMSRG9ja2VyIEJvaWxlcnBsYXRlMQ0wCwYD +VQQDFAQqLnZtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAyt0yFIsg +713pVnmPVVzK6Y7mbWKVUg7AAi6YxVITJ7D+f4ik9FW3mcqh75sGYwIOBmNdHfsm +Q3YL/8XrtBzzhW7UeqQqddHdbXSx2baOQsrsbuyELAFY5w+iqO1xcLTZO/aOiWXw +BWhi+MOTKJK1ZgrbKZ7DGR+/+81OH/enGxd/cy6KZ6blxg+regwPEI94MtHbmk47 +ONm2ETfq8C81SgHr/fYkOJDzCZ+L1ev15Oq7aEswuuxkMlWWGhcqYnA9UjbbEZoB +Fb4wgQ26yzp3lIkcH3+qsRLGYux8b+wShY+IlFpyCOyv5z+0+rgR0IxzvhabBpFP +ZQjKwnlRQXvJCs/3G4Xfsi1MV8AD6+oEjj5sJ9t9hsuLaM76mR6W1MbIMe7E93o/ +SuuodQ+yfgYzRVmDNYW5wta+x/8UuxAcwVfKkaEAlXtPCbn+cbKLlxWpA3JS1ePi +/tXMZKcLAkA5cuYN7Zv0wagNjvmSfmB0AxypMzMoS7OotF/zOaryQYi4NRi0wktt +K6UOYF0xBriDah4MF0FpFDum4YEmKnRxl9822efqlqSOHrot3R2dS5dFR+iHKW+z +kU0MIXOlvCgZcm7LGD0pRjhARlI2BjYXqM/RaaEpMQorPj/GTSra5qT6KkrtHjjh +hThRxtNnjoD1cUsKw3jfTFSaOwT8rBjByZkCAwEAAaAAMA0GCSqGSIb3DQEBCwUA +A4ICAQBsEBgC2YepuZq/8UqvKMZKVy/etDKXj7BB+QPb+leNiKD7p4LDxHJsZSH8 +Ku9uMPeLfiQDn5jA41k5SlGttzvObd65RdEbO3yHpqsg05EGSDDLfaE1k2Al/qmX +/o8roPZF7+2kZthgMAgkcokS54LYqEYTGqOf3J9Ss0yRIZwhaOVebfFIbIOdpw0B +JNMIJPHTMdZrcuRVI+wR1uPLIlEJzBvxTGbTrvPU25WJFtu+EajKqXO0SHdy0yx8 +uH4ykRBJRc36+oYo7nZ5D56dh7pZn3+9J64FKAOV0Q3KqMFieGy053ezuhJd70eZ +UozTgfjs3WpMzoYmKETSyl3XZSdInRe+sUlKPruTsKyg69oYxjPlrGfAmmGcCFca +TnZinT18dI92zK7OtOVkmYeYKC1lwuhftVrNMXzZuHOGpS9NNYtc4nDqDMIEOfV3 +6rCdu03WjEgJ+Z67tJs16xOx9du4/EHxS2Ijn9DPfVJvYy0TgzDi1BUpjWx0KTLx +C4OQbEZ/QTWmHVbSch/hcZhzbf7SNh5RpnW4EtmcpDFjIKMfxJmoKeiTf7qnilx0 +7uRvsZFKoDKRDOFiPfgMg5AOtLHziYsd9m0tJjC2GHvFuPjzOtzhnUUjmmvht170 +2aqKakjST4amg7jzLcs871HX0/WjOtt29NpOz140blkKf1bisg== +-----END CERTIFICATE REQUEST----- \ No newline at end of file diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/ssl/server.key b/docker/php-nginx/8.6-alpine/conf/etc/nginx/ssl/server.key new file mode 100644 index 000000000..c9eec145f --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/ssl/server.key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAyt0yFIsg713pVnmPVVzK6Y7mbWKVUg7AAi6YxVITJ7D+f4ik +9FW3mcqh75sGYwIOBmNdHfsmQ3YL/8XrtBzzhW7UeqQqddHdbXSx2baOQsrsbuyE +LAFY5w+iqO1xcLTZO/aOiWXwBWhi+MOTKJK1ZgrbKZ7DGR+/+81OH/enGxd/cy6K +Z6blxg+regwPEI94MtHbmk47ONm2ETfq8C81SgHr/fYkOJDzCZ+L1ev15Oq7aEsw +uuxkMlWWGhcqYnA9UjbbEZoBFb4wgQ26yzp3lIkcH3+qsRLGYux8b+wShY+IlFpy +COyv5z+0+rgR0IxzvhabBpFPZQjKwnlRQXvJCs/3G4Xfsi1MV8AD6+oEjj5sJ9t9 +hsuLaM76mR6W1MbIMe7E93o/SuuodQ+yfgYzRVmDNYW5wta+x/8UuxAcwVfKkaEA +lXtPCbn+cbKLlxWpA3JS1ePi/tXMZKcLAkA5cuYN7Zv0wagNjvmSfmB0AxypMzMo +S7OotF/zOaryQYi4NRi0wkttK6UOYF0xBriDah4MF0FpFDum4YEmKnRxl9822efq +lqSOHrot3R2dS5dFR+iHKW+zkU0MIXOlvCgZcm7LGD0pRjhARlI2BjYXqM/RaaEp +MQorPj/GTSra5qT6KkrtHjjhhThRxtNnjoD1cUsKw3jfTFSaOwT8rBjByZkCAwEA +AQKCAgAbZPdoUsllyZbC+LNkYZ19ILD5QIDNjfRb1xMGQmkXyQz1B+zOmeyrNfPc +OWEJabOfJTfj3pByN7SzG3US4333HNpQnW6mbmqqZ0HFFqPrXR/Ecuf+UUhCG5hp +m3bgM2vKbyccYsmg0VHcKfzrU7RvTTP/UNMjx2fThwvvwS+ttuSdF0HVcXJB5sfP +OWWnZNhkdHZlRf81VCED/jsZqCZYEh5eMyj9AoXvXL4zayPPf+tC0DSKaXW2Xlxg +tZQhqup8+a9nlxZia0Z9hu8clo6jXkiP8FuKgfCMV0cOjiCKLLHS5svTbLLsVWwJ +F2ZAdVcD6mWQ43qHOEK5NEzGvQKO14CaOLnVT2yAkMcyNohsEgoDP9oCBGDJQbBH +NmtZfpVjjtuTr9P9TEkU1FcBRo0x6Il/DkzamGbOeFAmgnaGElhJ5c/CAG7whaIf +mUfFOBGPH/wESY3gBOACDofeSh27RrlvbLaPiCGKivDUTBmhBsIuso6XqOKbvtfV +/HhhndpdRVfIj4DdE7gIrLIGN977JMVAXFCNz7KrvAWwcOXrCHCoWpklJ9repq8l +26ICY8K7VXktzDHQUmhd88ZWR+9ASURsJghUgZUOcMrEGyvci6Y8hpLhHiNVPHuQ ++ps7tpPsXSntBUqWBzhRZh74+nJlOOV6oYykl30JT2JzB6lwiQKCAQEA9ecn8N2z +20tR2UEiTv/MjVSepQtAAajegvcd1iasvvQKXnh3XLmoZHzH2tTa0lp5RIZpUQPl +lOTwko0lYTBnYblt65AJQ3FTgisNobIpoqE8BFXLm6wggz7CbabjmPGDe173lPGR +sI0YSKYvzrdn4zw8Fh6WULJyZHLi58zJYL3r0WBDiOoxpGaGA1GlmkuIWjhKHaX2 +OvF1vOuQDJ2eDyTc5TYFC0NKG76Mvanov5L/yrhNM/umbmp0SPspzHGZobAKUr20 +OazFT8S+2TA1OTxWNbiPbSimFoaZbEdqsNACGfVJWO8Sh8iqlt5RmEcSiSvGBj6L +QKprRO9Fsp2GawKCAQEA0zGhRsnux4JTNsdUSYsEJtITMj6eE+nl7CoZ9DAOwC5X +6/aSpUE4TT+pWNrt9iluXiGL0j89UJ7r/L1OcsiyzGb8ig9NU4zr1NIGTZ0DstHi +HPYINjeiBJEFIy17kOQn+9/I5c4hBUwz6ihwNoEomymVB/EsLJKAML0AudJGKg+Z +/f/qrS40eab5SAiaKgsh0MZnj+vIxyGBydt6r2HGmjfNITVbXIu6IpO+6NXDwM/e +7v10AAZ3j9+gb1RedLg2ghuIuYU90hmMhtVWsh9nVmaOkMW9/WFgOPYvt/mHH/hR +d4pePZ9kACGmqo/b9sHvHw1YEubtCt1VUiNuFxnJCwKCAQBWnxz0vkRTJY8phsY9 +KeK2jm5sGTBs5T2syLwb6ffENFdKvAjgAw6Mh2And/+1ReWd+/MxdLv03UjZdxsJ +x3FDfXx5FH4O4ebW3a+pnAcKoN1xcX+N0O6LDRqUYcue3sTAOs3gC9CUbr91KAWD +Phw8ccWAzTmKJ7IgLFA982ekyoI9eTmRC159WRgwJxy844qerWF+XC4GyXP+HsTZ +jNRW5Vdi7sqMEyIR7+fIEAhLI88zbATWIPmZv6pC4ybwO7wwtsCMMQNBpdjDprzL +6S12ggikV+U+QKlxGe0FtYqhykRTPJKf32eZqVheWOZJTA/9fgv9ux52oxGycM8O +gmsNAoIBAQC60m5uZnd5uYnPLWkcXYNgq/kbO1UvHHut/FhVMKX7z4MrU0XKNfWO +MECoP5K9bU0aq+Y6KIMe7FapjvT0iSHRu1Cu+HZY8JI2A0xcIAeDijLRl7sP6wrB +q1+2DKgANjRAlWfsEfoX658JBpitPngjOheBnRCMpVQMyUT5HE/BKWf5zwdUB0mY +S+K8nA90HcDeJIS8RcGolbVwUV0oBABhr/cf50lYhqozqCr7YQ33ZGs7Uq3oz8+4 +UARmN2YPLl3Znm3GX12em8c6B0LX8vvA7Jw06Rf2Ksup1+3Ce1PTLiEy9A4FyRf3 +Hc2HmBbnJAtZlr5QikMqlzzAmmLqwH6dAoIBAC+ryaQGJFsijCSuaDfRp/uy9xnd +DjgMdTwjl5WLBmyudChVMANl8eqCbvVO41CN84yORk03oQ4cx0eKxAZaLaSzgkb3 +W0X2nFQe7VJSYMQswCQ+1WfJvEFrIdkEKIa//uQdhqNrgUKSNVhhSTMbNEkDTIWn +ssbv2H9hvUaFt/J/vP9zCKuU5oYvNU7Oi6ZXRYezRn9atlJYanLFoJnHUBRzGms5 +K0vhdCPDXQq87z5Yudoh0jLUQF9Nx0GTWeBceQ9n5hZeRUNQWxP4AJThQX9KSPTS +mbL3Kh4XNRmAUJ2N+Njh+3dg91s+JkKvC1wcspLsmLPQe+9AxBSH9y5JE/8= +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.conf new file mode 100644 index 000000000..a5df62ef8 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.conf @@ -0,0 +1,2 @@ +# compatibility for PHP and TYPO3 Docker Boilerplate +include /opt/docker/etc/nginx/vhost.common.d/*.conf; diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/.gitkeep b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-general.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-general.conf new file mode 100644 index 000000000..31c9bf05a --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-general.conf @@ -0,0 +1 @@ +client_max_body_size ; diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-location-root.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-location-root.conf new file mode 100644 index 000000000..28fd811bc --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-location-root.conf @@ -0,0 +1,3 @@ +location / { + try_files $uri $uri/ /?$query_string; +} diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-log.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-log.conf new file mode 100644 index 000000000..9646c6826 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-log.conf @@ -0,0 +1,2 @@ +access_log /docker.stdout; +error_log /docker.stderr warn; diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-php.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-php.conf new file mode 100644 index 000000000..22b08a50d --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.common.d/10-php.conf @@ -0,0 +1,7 @@ +location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_read_timeout ; +} diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.conf new file mode 100644 index 000000000..8836f5e3a --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.conf @@ -0,0 +1,30 @@ +server { + listen 80 default_server; + # IPv6; the files are deleted at start if the container has no IPv6 + include /opt/docker/etc/nginx/vhost.ipv6/listen-80*.conf; + + server_name _ docker; + + root ""; + index ; + + include /opt/docker/etc/nginx/vhost.common.d/*.conf; +} + +############## +# SSL +############## + +server { + listen 443 ssl default_server; + # IPv6; the files are deleted at start if the container has no IPv6 + include /opt/docker/etc/nginx/vhost.ipv6/listen-443*.conf; + + server_name _ docker; + + root ""; + index ; + + include /opt/docker/etc/nginx/vhost.common.d/*.conf; + include /opt/docker/etc/nginx/vhost.ssl.conf; +} diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.ipv6/listen-443.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.ipv6/listen-443.conf new file mode 100644 index 000000000..17937e4b2 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.ipv6/listen-443.conf @@ -0,0 +1 @@ +listen [::]:443 ssl default_server; diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.ipv6/listen-80.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.ipv6/listen-80.conf new file mode 100644 index 000000000..f2632c6d9 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.ipv6/listen-80.conf @@ -0,0 +1 @@ +listen [::]:80 default_server; diff --git a/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.ssl.conf b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.ssl.conf new file mode 100644 index 000000000..28e8aab17 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/nginx/vhost.ssl.conf @@ -0,0 +1,6 @@ +ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # not possible to do exclusive +ssl_ciphers 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA'; +ssl_prefer_server_ciphers on; + +ssl_certificate /opt/docker/etc/nginx/ssl/server.crt; +ssl_certificate_key /opt/docker/etc/nginx/ssl/server.key; diff --git a/docker/php-nginx/8.6-alpine/conf/etc/supervisor.d/nginx.conf b/docker/php-nginx/8.6-alpine/conf/etc/supervisor.d/nginx.conf new file mode 100644 index 000000000..657bf499b --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/etc/supervisor.d/nginx.conf @@ -0,0 +1,14 @@ +[group:nginx] +programs=nginxd +priority=20 + +[program:nginxd] +command = /opt/docker/bin/service.d/nginx.sh +process_name=%(program_name)s +startsecs = 0 +autostart = true +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-nginx/8.6-alpine/conf/provision/bootstrap.d/.gitkeep b/docker/php-nginx/8.6-alpine/conf/provision/bootstrap.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-nginx/8.6-alpine/conf/provision/bootstrap.d/10-nginx.sh b/docker/php-nginx/8.6-alpine/conf/provision/bootstrap.d/10-nginx.sh new file mode 100644 index 000000000..1ba70f963 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/provision/bootstrap.d/10-nginx.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +# Remove daemon statement (will be added as command line argument) +go-replace --mode=lineinfile --regex --regex-backrefs \ + -s '^[\s#]*daemon ' -r '' \ + -- /etc/nginx/nginx.conf + +go-replace --mode=line --regex --regex-backrefs \ + -s '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' -r '$1 /docker.stdout $3' \ + -s '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' -r '$1 /docker.stderr $3' \ + -- /etc/nginx/nginx.conf + +# Enable nginx main config +mkdir -p /etc/nginx/conf.d/ +ln -sf /opt/docker/etc/nginx/main.conf /etc/nginx/conf.d/10-docker.conf + +rm -f \ + /etc/nginx/sites-enabled/default \ + /etc/nginx/conf.d/default.conf + +if [[ "$IMAGE_FAMILY" == "RedHat" ]] || [[ "$IMAGE_FAMILY" == "Alpine" ]]; then + ln -sf /opt/docker/etc/nginx/nginx.conf /etc/nginx/nginx.conf +fi + +# Clear log dir +rm -rf /var/lib/nginx/logs +mkdir -p /var/lib/nginx/logs + +# Set log to stdout/stderr +ln -sf /var/lib/nginx/logs/access.log /docker.stdout +ln -sf /var/lib/nginx/logs/error.log /docker.stderr + +# Fix rights of ssl files +chown -R root:root /opt/docker/etc/nginx/ssl +find /opt/docker/etc/nginx/ssl -type d -exec chmod 750 {} \; +find /opt/docker/etc/nginx/ssl -type f -exec chmod 640 {} \; diff --git a/docker/php-nginx/8.6-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx/8.6-alpine/conf/provision/bootstrap.d/10-php.sh new file mode 100644 index 000000000..4a7d82647 --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/provision/bootstrap.d/10-php.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# Restrict php-fpm to local connection +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 127.0.0.1:9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' diff --git a/docker/php-nginx/8.6-alpine/conf/provision/entrypoint.d/.gitkeep b/docker/php-nginx/8.6-alpine/conf/provision/entrypoint.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-nginx/8.6-alpine/conf/provision/entrypoint.d/20-nginx.sh b/docker/php-nginx/8.6-alpine/conf/provision/entrypoint.d/20-nginx.sh new file mode 100644 index 000000000..cefd9a4fd --- /dev/null +++ b/docker/php-nginx/8.6-alpine/conf/provision/entrypoint.d/20-nginx.sh @@ -0,0 +1,30 @@ +# Create tmp dir for nginx +mkdir -p /var/tmp/nginx/ + +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + +# Replace markers +go-replace \ + -s "" -r "$WEB_DOCUMENT_INDEX" \ + -s "" -r "$WEB_DOCUMENT_ROOT" \ + -s "" -r "$WEB_ALIAS_DOMAIN" \ + -s "" -r "$HOSTNAME" \ + -s "" -r "$WEB_PHP_SOCKET" \ + -s "" -r "$WEB_PHP_TIMEOUT" \ + -s "" -r "$SERVICE_NGINX_CLIENT_MAX_BODY_SIZE" \ + --path=/opt/docker/etc/nginx/ \ + --path-pattern='*.conf' \ + --ignore-empty + +if [[ -z "$WEB_PHP_SOCKET" ]]; then + ## WEB_PHP_SOCKET is not set, remove PHP files + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf +fi + +# Without IPv6 in the container nginx cannot listen on [::]: delete the IPv6 listen +# directives that vhost.conf includes, so nginx listens on IPv4 only +if [[ ! -e /proc/net/if_inet6 ]]; then + rm -f -- /opt/docker/etc/nginx/vhost.ipv6/*.conf || true +fi diff --git a/docker/php-nginx/8.6/Dockerfile b/docker/php-nginx/8.6/Dockerfile new file mode 100644 index 000000000..4f8e6b743 --- /dev/null +++ b/docker/php-nginx/8.6/Dockerfile @@ -0,0 +1,29 @@ +#+++++++++++++++++++++++++++++++++++++++ +# Dockerfile for webdevops/php-nginx:8.6 +# -- automatically generated -- +#+++++++++++++++++++++++++++++++++++++++ + +FROM webdevops/php:8.6 + +ENV WEB_DOCUMENT_ROOT=/app \ + WEB_DOCUMENT_INDEX=index.php \ + WEB_ALIAS_DOMAIN=*.vm \ + WEB_PHP_TIMEOUT=600 \ + WEB_PHP_SOCKET="" +ENV WEB_PHP_SOCKET=127.0.0.1:9000 +ENV SERVICE_NGINX_CLIENT_MAX_BODY_SIZE="50m" + +COPY conf/ /opt/docker/ + +RUN set -x \ + # Install nginx + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://nginx.org/keys/nginx_signing.key -o /etc/apt/keyrings/nginx.asc \ + && printf "deb [signed-by=/etc/apt/keyrings/nginx.asc] https://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx\n" \ + > /etc/apt/sources.list.d/nginx.list \ + && apt-install \ + nginx \ + && docker-run-bootstrap \ + && docker-image-cleanup + +EXPOSE 80 443 diff --git a/docker/php-nginx/8.6/Dockerfile.twig b/docker/php-nginx/8.6/Dockerfile.twig new file mode 100644 index 000000000..178b222fb --- /dev/null +++ b/docker/php-nginx/8.6/Dockerfile.twig @@ -0,0 +1,18 @@ +{% import 'docker.twig' as docker %} +{% import 'provision.twig' as provision %} +{% import 'environment.twig' as environment %} +{% import 'images/nginx.twig' as nginx %} +{{ docker.from("php", "8.6") }} + +{{ environment.web() }} +{{ environment.webPhp() }} +{{ environment.nginx() }} + +{{ docker.copy('conf/', '/opt/docker/') }} + +RUN set -x \ + {{ nginx.debian() }} \ + {{ provision.runBootstrap() }} \ + {{ docker.cleanup() }} + +{{ docker.expose('80 443') }} diff --git a/docker/php-nginx/8.6/conf/bin/service.d/nginx.d/10-init.sh b/docker/php-nginx/8.6/conf/bin/service.d/nginx.d/10-init.sh new file mode 100644 index 000000000..8acb5111d --- /dev/null +++ b/docker/php-nginx/8.6/conf/bin/service.d/nginx.d/10-init.sh @@ -0,0 +1,5 @@ +if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then + echo "" + echo "[WARNING] WEB_DOCUMENT_ROOT does not exists with path \"$WEB_DOCUMENT_ROOT\"!" + echo "" +fi diff --git a/docker/php-nginx/8.6/conf/bin/service.d/nginx.sh b/docker/php-nginx/8.6/conf/bin/service.d/nginx.sh new file mode 100644 index 000000000..3517c72a5 --- /dev/null +++ b/docker/php-nginx/8.6/conf/bin/service.d/nginx.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_NGINX_OPTS" ]]; then SERVICE_NGINX_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/nginx.d/" + +exec /usr/sbin/nginx -g 'daemon off;' $SERVICE_NGINX_OPTS diff --git a/docker/php-nginx/8.6/conf/etc/nginx/conf.d/.gitkeep b/docker/php-nginx/8.6/conf/etc/nginx/conf.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-nginx/8.6/conf/etc/nginx/conf.d/10-php.conf b/docker/php-nginx/8.6/conf/etc/nginx/conf.d/10-php.conf new file mode 100644 index 000000000..9abe45f0a --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/conf.d/10-php.conf @@ -0,0 +1,3 @@ +upstream php { + server ; +} diff --git a/docker/php-nginx/8.6/conf/etc/nginx/global.conf b/docker/php-nginx/8.6/conf/etc/nginx/global.conf new file mode 100644 index 000000000..b6141db09 --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/global.conf @@ -0,0 +1 @@ +# deprecated diff --git a/docker/php-nginx/8.6/conf/etc/nginx/main.conf b/docker/php-nginx/8.6/conf/etc/nginx/main.conf new file mode 100644 index 000000000..06de0651b --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/main.conf @@ -0,0 +1,4 @@ +include /opt/docker/etc/nginx/global.conf; +include /opt/docker/etc/nginx/php.conf; +include /opt/docker/etc/nginx/conf.d/*.conf; +include /opt/docker/etc/nginx/vhost.conf; diff --git a/docker/php-nginx/8.6/conf/etc/nginx/php.conf b/docker/php-nginx/8.6/conf/etc/nginx/php.conf new file mode 100644 index 000000000..b6141db09 --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/php.conf @@ -0,0 +1 @@ +# deprecated diff --git a/docker/php-nginx/8.6/conf/etc/nginx/ssl/server.crt b/docker/php-nginx/8.6/conf/etc/nginx/ssl/server.crt new file mode 100644 index 000000000..6b0694907 --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/ssl/server.crt @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIE1DCCArwCCQDMMwGnSuK0tTANBgkqhkiG9w0BAQsFADAsMRswGQYDVQQKExJE +b2NrZXIgQm9pbGVycGxhdGUxDTALBgNVBAMUBCoudm0wHhcNMTUwNTA0MTcxNDQw +WhcNMjUwNTAxMTcxNDQwWjAsMRswGQYDVQQKExJEb2NrZXIgQm9pbGVycGxhdGUx +DTALBgNVBAMUBCoudm0wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDK +3TIUiyDvXelWeY9VXMrpjuZtYpVSDsACLpjFUhMnsP5/iKT0VbeZyqHvmwZjAg4G +Y10d+yZDdgv/xeu0HPOFbtR6pCp10d1tdLHZto5Cyuxu7IQsAVjnD6Ko7XFwtNk7 +9o6JZfAFaGL4w5MokrVmCtspnsMZH7/7zU4f96cbF39zLopnpuXGD6t6DA8Qj3gy +0duaTjs42bYRN+rwLzVKAev99iQ4kPMJn4vV6/Xk6rtoSzC67GQyVZYaFypicD1S +NtsRmgEVvjCBDbrLOneUiRwff6qxEsZi7Hxv7BKFj4iUWnII7K/nP7T6uBHQjHO+ +FpsGkU9lCMrCeVFBe8kKz/cbhd+yLUxXwAPr6gSOPmwn232Gy4tozvqZHpbUxsgx +7sT3ej9K66h1D7J+BjNFWYM1hbnC1r7H/xS7EBzBV8qRoQCVe08Juf5xsouXFakD +clLV4+L+1cxkpwsCQDly5g3tm/TBqA2O+ZJ+YHQDHKkzMyhLs6i0X/M5qvJBiLg1 +GLTCS20rpQ5gXTEGuINqHgwXQWkUO6bhgSYqdHGX3zbZ5+qWpI4eui3dHZ1Ll0VH +6Icpb7ORTQwhc6W8KBlybssYPSlGOEBGUjYGNheoz9FpoSkxCis+P8ZNKtrmpPoq +Su0eOOGFOFHG02eOgPVxSwrDeN9MVJo7BPysGMHJmQIDAQABMA0GCSqGSIb3DQEB +CwUAA4ICAQC63g6NHmQKbiy3G6iaDkpUSbr5Mq2YgU61XnvWVyREqDcy/BXCw9oY +SJ/KUvCpqPnACNOFqjadRAmPiA9nf2WduoCgwQGV/YRFGswSuVvh/3X2TX5NWvbS +t8MQDttQg1dxpiMUjlu3rqhfohBdWJvp2lVSdpDb/MOlXBc/+p7HfOHwhqB7wwPN +NNbSKUbZqZxmD8cOf1X0hASr1yfFPj+2vST3ESaON8S0T2p63YX/sD5jvOUiEuyw +I5WcvLmiRZA07SH8nWyckLY3qWL+OlhSZrlAnolWS00b+7h5LNuRYEjKzwVgntoA +aCopyQih6wIk0+AfJO4sfhJBmQhnIrAaP/zwBH5g9zVizLf5H7U+hNXrMwgw55Sq +vjMdkZHvPKUXTvVit/rYE9H+PY3brkRWzOl4V/i/ZLJJm5805H/NyTbz9kPMJw2Q +nn+KOpfXXySD39f8iuRgSKXsYNul38hxWgcZZ6g+sOOp2n/VUmf0eZUWNnJ8i7AP +4Qif7aDKMcibOwSwsB+DKZXDvZ5XSdnMphtuLS5rPSL81rVRmWC2DMfQ2eP8j0WN +VTroSk0xedQ7Qr+9TNooi9IyzX6n1a2S1UiciEZ3ZcDbXPl/P01m+IYZyPnLv0+9 +ZeioZYh1JLv3/OKsMrMLTfh2ZCj3aXwmc2Owi/wU2LS5QUOMcHH7CQ== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/docker/php-nginx/8.6/conf/etc/nginx/ssl/server.csr b/docker/php-nginx/8.6/conf/etc/nginx/ssl/server.csr new file mode 100644 index 000000000..8a9909f77 --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/ssl/server.csr @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIEcTCCAlkCAQAwLDEbMBkGA1UEChMSRG9ja2VyIEJvaWxlcnBsYXRlMQ0wCwYD +VQQDFAQqLnZtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAyt0yFIsg +713pVnmPVVzK6Y7mbWKVUg7AAi6YxVITJ7D+f4ik9FW3mcqh75sGYwIOBmNdHfsm +Q3YL/8XrtBzzhW7UeqQqddHdbXSx2baOQsrsbuyELAFY5w+iqO1xcLTZO/aOiWXw +BWhi+MOTKJK1ZgrbKZ7DGR+/+81OH/enGxd/cy6KZ6blxg+regwPEI94MtHbmk47 +ONm2ETfq8C81SgHr/fYkOJDzCZ+L1ev15Oq7aEswuuxkMlWWGhcqYnA9UjbbEZoB +Fb4wgQ26yzp3lIkcH3+qsRLGYux8b+wShY+IlFpyCOyv5z+0+rgR0IxzvhabBpFP +ZQjKwnlRQXvJCs/3G4Xfsi1MV8AD6+oEjj5sJ9t9hsuLaM76mR6W1MbIMe7E93o/ +SuuodQ+yfgYzRVmDNYW5wta+x/8UuxAcwVfKkaEAlXtPCbn+cbKLlxWpA3JS1ePi +/tXMZKcLAkA5cuYN7Zv0wagNjvmSfmB0AxypMzMoS7OotF/zOaryQYi4NRi0wktt +K6UOYF0xBriDah4MF0FpFDum4YEmKnRxl9822efqlqSOHrot3R2dS5dFR+iHKW+z +kU0MIXOlvCgZcm7LGD0pRjhARlI2BjYXqM/RaaEpMQorPj/GTSra5qT6KkrtHjjh +hThRxtNnjoD1cUsKw3jfTFSaOwT8rBjByZkCAwEAAaAAMA0GCSqGSIb3DQEBCwUA +A4ICAQBsEBgC2YepuZq/8UqvKMZKVy/etDKXj7BB+QPb+leNiKD7p4LDxHJsZSH8 +Ku9uMPeLfiQDn5jA41k5SlGttzvObd65RdEbO3yHpqsg05EGSDDLfaE1k2Al/qmX +/o8roPZF7+2kZthgMAgkcokS54LYqEYTGqOf3J9Ss0yRIZwhaOVebfFIbIOdpw0B +JNMIJPHTMdZrcuRVI+wR1uPLIlEJzBvxTGbTrvPU25WJFtu+EajKqXO0SHdy0yx8 +uH4ykRBJRc36+oYo7nZ5D56dh7pZn3+9J64FKAOV0Q3KqMFieGy053ezuhJd70eZ +UozTgfjs3WpMzoYmKETSyl3XZSdInRe+sUlKPruTsKyg69oYxjPlrGfAmmGcCFca +TnZinT18dI92zK7OtOVkmYeYKC1lwuhftVrNMXzZuHOGpS9NNYtc4nDqDMIEOfV3 +6rCdu03WjEgJ+Z67tJs16xOx9du4/EHxS2Ijn9DPfVJvYy0TgzDi1BUpjWx0KTLx +C4OQbEZ/QTWmHVbSch/hcZhzbf7SNh5RpnW4EtmcpDFjIKMfxJmoKeiTf7qnilx0 +7uRvsZFKoDKRDOFiPfgMg5AOtLHziYsd9m0tJjC2GHvFuPjzOtzhnUUjmmvht170 +2aqKakjST4amg7jzLcs871HX0/WjOtt29NpOz140blkKf1bisg== +-----END CERTIFICATE REQUEST----- \ No newline at end of file diff --git a/docker/php-nginx/8.6/conf/etc/nginx/ssl/server.key b/docker/php-nginx/8.6/conf/etc/nginx/ssl/server.key new file mode 100644 index 000000000..c9eec145f --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/ssl/server.key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKAIBAAKCAgEAyt0yFIsg713pVnmPVVzK6Y7mbWKVUg7AAi6YxVITJ7D+f4ik +9FW3mcqh75sGYwIOBmNdHfsmQ3YL/8XrtBzzhW7UeqQqddHdbXSx2baOQsrsbuyE +LAFY5w+iqO1xcLTZO/aOiWXwBWhi+MOTKJK1ZgrbKZ7DGR+/+81OH/enGxd/cy6K +Z6blxg+regwPEI94MtHbmk47ONm2ETfq8C81SgHr/fYkOJDzCZ+L1ev15Oq7aEsw +uuxkMlWWGhcqYnA9UjbbEZoBFb4wgQ26yzp3lIkcH3+qsRLGYux8b+wShY+IlFpy +COyv5z+0+rgR0IxzvhabBpFPZQjKwnlRQXvJCs/3G4Xfsi1MV8AD6+oEjj5sJ9t9 +hsuLaM76mR6W1MbIMe7E93o/SuuodQ+yfgYzRVmDNYW5wta+x/8UuxAcwVfKkaEA +lXtPCbn+cbKLlxWpA3JS1ePi/tXMZKcLAkA5cuYN7Zv0wagNjvmSfmB0AxypMzMo +S7OotF/zOaryQYi4NRi0wkttK6UOYF0xBriDah4MF0FpFDum4YEmKnRxl9822efq +lqSOHrot3R2dS5dFR+iHKW+zkU0MIXOlvCgZcm7LGD0pRjhARlI2BjYXqM/RaaEp +MQorPj/GTSra5qT6KkrtHjjhhThRxtNnjoD1cUsKw3jfTFSaOwT8rBjByZkCAwEA +AQKCAgAbZPdoUsllyZbC+LNkYZ19ILD5QIDNjfRb1xMGQmkXyQz1B+zOmeyrNfPc +OWEJabOfJTfj3pByN7SzG3US4333HNpQnW6mbmqqZ0HFFqPrXR/Ecuf+UUhCG5hp +m3bgM2vKbyccYsmg0VHcKfzrU7RvTTP/UNMjx2fThwvvwS+ttuSdF0HVcXJB5sfP +OWWnZNhkdHZlRf81VCED/jsZqCZYEh5eMyj9AoXvXL4zayPPf+tC0DSKaXW2Xlxg +tZQhqup8+a9nlxZia0Z9hu8clo6jXkiP8FuKgfCMV0cOjiCKLLHS5svTbLLsVWwJ +F2ZAdVcD6mWQ43qHOEK5NEzGvQKO14CaOLnVT2yAkMcyNohsEgoDP9oCBGDJQbBH +NmtZfpVjjtuTr9P9TEkU1FcBRo0x6Il/DkzamGbOeFAmgnaGElhJ5c/CAG7whaIf +mUfFOBGPH/wESY3gBOACDofeSh27RrlvbLaPiCGKivDUTBmhBsIuso6XqOKbvtfV +/HhhndpdRVfIj4DdE7gIrLIGN977JMVAXFCNz7KrvAWwcOXrCHCoWpklJ9repq8l +26ICY8K7VXktzDHQUmhd88ZWR+9ASURsJghUgZUOcMrEGyvci6Y8hpLhHiNVPHuQ ++ps7tpPsXSntBUqWBzhRZh74+nJlOOV6oYykl30JT2JzB6lwiQKCAQEA9ecn8N2z +20tR2UEiTv/MjVSepQtAAajegvcd1iasvvQKXnh3XLmoZHzH2tTa0lp5RIZpUQPl +lOTwko0lYTBnYblt65AJQ3FTgisNobIpoqE8BFXLm6wggz7CbabjmPGDe173lPGR +sI0YSKYvzrdn4zw8Fh6WULJyZHLi58zJYL3r0WBDiOoxpGaGA1GlmkuIWjhKHaX2 +OvF1vOuQDJ2eDyTc5TYFC0NKG76Mvanov5L/yrhNM/umbmp0SPspzHGZobAKUr20 +OazFT8S+2TA1OTxWNbiPbSimFoaZbEdqsNACGfVJWO8Sh8iqlt5RmEcSiSvGBj6L +QKprRO9Fsp2GawKCAQEA0zGhRsnux4JTNsdUSYsEJtITMj6eE+nl7CoZ9DAOwC5X +6/aSpUE4TT+pWNrt9iluXiGL0j89UJ7r/L1OcsiyzGb8ig9NU4zr1NIGTZ0DstHi +HPYINjeiBJEFIy17kOQn+9/I5c4hBUwz6ihwNoEomymVB/EsLJKAML0AudJGKg+Z +/f/qrS40eab5SAiaKgsh0MZnj+vIxyGBydt6r2HGmjfNITVbXIu6IpO+6NXDwM/e +7v10AAZ3j9+gb1RedLg2ghuIuYU90hmMhtVWsh9nVmaOkMW9/WFgOPYvt/mHH/hR +d4pePZ9kACGmqo/b9sHvHw1YEubtCt1VUiNuFxnJCwKCAQBWnxz0vkRTJY8phsY9 +KeK2jm5sGTBs5T2syLwb6ffENFdKvAjgAw6Mh2And/+1ReWd+/MxdLv03UjZdxsJ +x3FDfXx5FH4O4ebW3a+pnAcKoN1xcX+N0O6LDRqUYcue3sTAOs3gC9CUbr91KAWD +Phw8ccWAzTmKJ7IgLFA982ekyoI9eTmRC159WRgwJxy844qerWF+XC4GyXP+HsTZ +jNRW5Vdi7sqMEyIR7+fIEAhLI88zbATWIPmZv6pC4ybwO7wwtsCMMQNBpdjDprzL +6S12ggikV+U+QKlxGe0FtYqhykRTPJKf32eZqVheWOZJTA/9fgv9ux52oxGycM8O +gmsNAoIBAQC60m5uZnd5uYnPLWkcXYNgq/kbO1UvHHut/FhVMKX7z4MrU0XKNfWO +MECoP5K9bU0aq+Y6KIMe7FapjvT0iSHRu1Cu+HZY8JI2A0xcIAeDijLRl7sP6wrB +q1+2DKgANjRAlWfsEfoX658JBpitPngjOheBnRCMpVQMyUT5HE/BKWf5zwdUB0mY +S+K8nA90HcDeJIS8RcGolbVwUV0oBABhr/cf50lYhqozqCr7YQ33ZGs7Uq3oz8+4 +UARmN2YPLl3Znm3GX12em8c6B0LX8vvA7Jw06Rf2Ksup1+3Ce1PTLiEy9A4FyRf3 +Hc2HmBbnJAtZlr5QikMqlzzAmmLqwH6dAoIBAC+ryaQGJFsijCSuaDfRp/uy9xnd +DjgMdTwjl5WLBmyudChVMANl8eqCbvVO41CN84yORk03oQ4cx0eKxAZaLaSzgkb3 +W0X2nFQe7VJSYMQswCQ+1WfJvEFrIdkEKIa//uQdhqNrgUKSNVhhSTMbNEkDTIWn +ssbv2H9hvUaFt/J/vP9zCKuU5oYvNU7Oi6ZXRYezRn9atlJYanLFoJnHUBRzGms5 +K0vhdCPDXQq87z5Yudoh0jLUQF9Nx0GTWeBceQ9n5hZeRUNQWxP4AJThQX9KSPTS +mbL3Kh4XNRmAUJ2N+Njh+3dg91s+JkKvC1wcspLsmLPQe+9AxBSH9y5JE/8= +-----END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.conf b/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.conf new file mode 100644 index 000000000..a5df62ef8 --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.conf @@ -0,0 +1,2 @@ +# compatibility for PHP and TYPO3 Docker Boilerplate +include /opt/docker/etc/nginx/vhost.common.d/*.conf; diff --git a/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/.gitkeep b/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-general.conf b/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-general.conf new file mode 100644 index 000000000..31c9bf05a --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-general.conf @@ -0,0 +1 @@ +client_max_body_size ; diff --git a/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-location-root.conf b/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-location-root.conf new file mode 100644 index 000000000..28fd811bc --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-location-root.conf @@ -0,0 +1,3 @@ +location / { + try_files $uri $uri/ /?$query_string; +} diff --git a/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-log.conf b/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-log.conf new file mode 100644 index 000000000..9646c6826 --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-log.conf @@ -0,0 +1,2 @@ +access_log /docker.stdout; +error_log /docker.stderr warn; diff --git a/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-php.conf b/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-php.conf new file mode 100644 index 000000000..22b08a50d --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/vhost.common.d/10-php.conf @@ -0,0 +1,7 @@ +location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $request_filename; + fastcgi_read_timeout ; +} diff --git a/docker/php-nginx/8.6/conf/etc/nginx/vhost.conf b/docker/php-nginx/8.6/conf/etc/nginx/vhost.conf new file mode 100644 index 000000000..8836f5e3a --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/vhost.conf @@ -0,0 +1,30 @@ +server { + listen 80 default_server; + # IPv6; the files are deleted at start if the container has no IPv6 + include /opt/docker/etc/nginx/vhost.ipv6/listen-80*.conf; + + server_name _ docker; + + root ""; + index ; + + include /opt/docker/etc/nginx/vhost.common.d/*.conf; +} + +############## +# SSL +############## + +server { + listen 443 ssl default_server; + # IPv6; the files are deleted at start if the container has no IPv6 + include /opt/docker/etc/nginx/vhost.ipv6/listen-443*.conf; + + server_name _ docker; + + root ""; + index ; + + include /opt/docker/etc/nginx/vhost.common.d/*.conf; + include /opt/docker/etc/nginx/vhost.ssl.conf; +} diff --git a/docker/php-nginx/8.6/conf/etc/nginx/vhost.ipv6/listen-443.conf b/docker/php-nginx/8.6/conf/etc/nginx/vhost.ipv6/listen-443.conf new file mode 100644 index 000000000..17937e4b2 --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/vhost.ipv6/listen-443.conf @@ -0,0 +1 @@ +listen [::]:443 ssl default_server; diff --git a/docker/php-nginx/8.6/conf/etc/nginx/vhost.ipv6/listen-80.conf b/docker/php-nginx/8.6/conf/etc/nginx/vhost.ipv6/listen-80.conf new file mode 100644 index 000000000..f2632c6d9 --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/vhost.ipv6/listen-80.conf @@ -0,0 +1 @@ +listen [::]:80 default_server; diff --git a/docker/php-nginx/8.6/conf/etc/nginx/vhost.ssl.conf b/docker/php-nginx/8.6/conf/etc/nginx/vhost.ssl.conf new file mode 100644 index 000000000..28e8aab17 --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/nginx/vhost.ssl.conf @@ -0,0 +1,6 @@ +ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # not possible to do exclusive +ssl_ciphers 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA'; +ssl_prefer_server_ciphers on; + +ssl_certificate /opt/docker/etc/nginx/ssl/server.crt; +ssl_certificate_key /opt/docker/etc/nginx/ssl/server.key; diff --git a/docker/php-nginx/8.6/conf/etc/supervisor.d/nginx.conf b/docker/php-nginx/8.6/conf/etc/supervisor.d/nginx.conf new file mode 100644 index 000000000..657bf499b --- /dev/null +++ b/docker/php-nginx/8.6/conf/etc/supervisor.d/nginx.conf @@ -0,0 +1,14 @@ +[group:nginx] +programs=nginxd +priority=20 + +[program:nginxd] +command = /opt/docker/bin/service.d/nginx.sh +process_name=%(program_name)s +startsecs = 0 +autostart = true +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-nginx/8.6/conf/provision/bootstrap.d/.gitkeep b/docker/php-nginx/8.6/conf/provision/bootstrap.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-nginx/8.6/conf/provision/bootstrap.d/10-nginx.sh b/docker/php-nginx/8.6/conf/provision/bootstrap.d/10-nginx.sh new file mode 100644 index 000000000..1ba70f963 --- /dev/null +++ b/docker/php-nginx/8.6/conf/provision/bootstrap.d/10-nginx.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +# Remove daemon statement (will be added as command line argument) +go-replace --mode=lineinfile --regex --regex-backrefs \ + -s '^[\s#]*daemon ' -r '' \ + -- /etc/nginx/nginx.conf + +go-replace --mode=line --regex --regex-backrefs \ + -s '^([ \t]*access_log)[ \t]*([^\t ;]+)(.*;)$' -r '$1 /docker.stdout $3' \ + -s '^([ \t]*error_log)[ \t]*([^\t ;]+)(.*;)$' -r '$1 /docker.stderr $3' \ + -- /etc/nginx/nginx.conf + +# Enable nginx main config +mkdir -p /etc/nginx/conf.d/ +ln -sf /opt/docker/etc/nginx/main.conf /etc/nginx/conf.d/10-docker.conf + +rm -f \ + /etc/nginx/sites-enabled/default \ + /etc/nginx/conf.d/default.conf + +if [[ "$IMAGE_FAMILY" == "RedHat" ]] || [[ "$IMAGE_FAMILY" == "Alpine" ]]; then + ln -sf /opt/docker/etc/nginx/nginx.conf /etc/nginx/nginx.conf +fi + +# Clear log dir +rm -rf /var/lib/nginx/logs +mkdir -p /var/lib/nginx/logs + +# Set log to stdout/stderr +ln -sf /var/lib/nginx/logs/access.log /docker.stdout +ln -sf /var/lib/nginx/logs/error.log /docker.stderr + +# Fix rights of ssl files +chown -R root:root /opt/docker/etc/nginx/ssl +find /opt/docker/etc/nginx/ssl -type d -exec chmod 750 {} \; +find /opt/docker/etc/nginx/ssl -type f -exec chmod 640 {} \; diff --git a/docker/php-nginx/8.6/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx/8.6/conf/provision/bootstrap.d/10-php.sh new file mode 100644 index 000000000..4a7d82647 --- /dev/null +++ b/docker/php-nginx/8.6/conf/provision/bootstrap.d/10-php.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# Restrict php-fpm to local connection +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 127.0.0.1:9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' diff --git a/docker/php-nginx/8.6/conf/provision/entrypoint.d/.gitkeep b/docker/php-nginx/8.6/conf/provision/entrypoint.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-nginx/8.6/conf/provision/entrypoint.d/20-nginx.sh b/docker/php-nginx/8.6/conf/provision/entrypoint.d/20-nginx.sh new file mode 100644 index 000000000..cefd9a4fd --- /dev/null +++ b/docker/php-nginx/8.6/conf/provision/entrypoint.d/20-nginx.sh @@ -0,0 +1,30 @@ +# Create tmp dir for nginx +mkdir -p /var/tmp/nginx/ + +# Prevent startup of nginx (ubuntu 16.04 needs it) +ln -f -s /var/lib/nginx/logs /var/log/nginx + +# Replace markers +go-replace \ + -s "" -r "$WEB_DOCUMENT_INDEX" \ + -s "" -r "$WEB_DOCUMENT_ROOT" \ + -s "" -r "$WEB_ALIAS_DOMAIN" \ + -s "" -r "$HOSTNAME" \ + -s "" -r "$WEB_PHP_SOCKET" \ + -s "" -r "$WEB_PHP_TIMEOUT" \ + -s "" -r "$SERVICE_NGINX_CLIENT_MAX_BODY_SIZE" \ + --path=/opt/docker/etc/nginx/ \ + --path-pattern='*.conf' \ + --ignore-empty + +if [[ -z "$WEB_PHP_SOCKET" ]]; then + ## WEB_PHP_SOCKET is not set, remove PHP files + rm -f -- /opt/docker/etc/nginx/conf.d/10-php.conf + rm -f -- /opt/docker/etc/nginx/vhost.common.d/10-php.conf +fi + +# Without IPv6 in the container nginx cannot listen on [::]: delete the IPv6 listen +# directives that vhost.conf includes, so nginx listens on IPv4 only +if [[ ! -e /proc/net/if_inet6 ]]; then + rm -f -- /opt/docker/etc/nginx/vhost.ipv6/*.conf || true +fi diff --git a/docker/php-official/8.2-alpine/Dockerfile b/docker/php-official/8.2-alpine/Dockerfile index 72a4bf0ee..5e5000f15 100644 --- a/docker/php-official/8.2-alpine/Dockerfile +++ b/docker/php-official/8.2-alpine/Dockerfile @@ -106,6 +106,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libzip \ libmemcached \ yaml \ + oniguruma \ # Build dependencies linux-headers \ autoconf \ @@ -135,6 +136,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libzip-dev \ libmemcached-dev \ yaml-dev \ + oniguruma-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ && unzip master.zip \ @@ -206,6 +208,8 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin && phpize && ./configure --enable-protobuf \ && make -j"$(nproc)" && make install \ && cd / && rm -rf /tmp/protobuf /tmp/protobuf.tar.gz \ + # Vips and XML-RPC are only built up to PHP 8.5: both are abandoned upstream and + # do not build against PHP 8.6. # Vips' GitHub tags lag behind PECL releases; use the upstream branch. && git clone --depth 1 https://github.com/libvips/php-vips-ext.git /tmp/vips \ && cd /tmp/vips \ @@ -222,13 +226,13 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin excimer \ opentelemetry \ protobuf \ - vips \ yaml \ redis \ - xmlrpc \ imagick \ mongodb \ memcached \ + vips \ + xmlrpc \ # Uninstall dev and header packages && apk del -f --purge \ autoconf \ @@ -259,6 +263,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libzip-dev \ libmemcached-dev \ yaml-dev \ + oniguruma-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ diff --git a/docker/php-official/8.2-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh b/docker/php-official/8.2-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh index 59a2d4245..8d15159dc 100644 --- a/docker/php-official/8.2-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh +++ b/docker/php-official/8.2-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh @@ -5,6 +5,13 @@ if [ $IMAGE_FAMILY == "Alpine" ]; then return fi +# The official PHP images are thread safe (ZTS) since PHP 8.6 and are built without +# Zend signals, which the ionCube ZTS loader needs (undefined zend_signal_globals_offset) +if [[ "$(php -n -r 'echo PHP_ZTS;')" == "1" ]]; then + echo "Skipping ionCube installation: the ionCube loader does not support this thread-safe PHP build" + return +fi + echo "Installing ionCube loader" case "$(uname -m)" in diff --git a/docker/php-official/8.2/Dockerfile b/docker/php-official/8.2/Dockerfile index 2235a9d97..f2b56927c 100644 --- a/docker/php-official/8.2/Dockerfile +++ b/docker/php-official/8.2/Dockerfile @@ -71,7 +71,7 @@ RUN set -x \ unzip \ bzip2 \ moreutils \ - dnsutils \ + bind9-dnsutils \ openssh-client \ rsync \ git \ @@ -99,22 +99,26 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Libraries libavif15 \ libvips42 \ - librabbitmq4 \ libldap-2.5-0 \ + libpng16-16 \ + libzip4 \ + libmemcached11 \ + librabbitmq4 \ libxslt1.1 \ libldap-common \ zlib1g \ libpq5 \ - libpng16-16 \ libmcrypt4 \ - libzip4 \ libyaml-0-2 \ + libonig5 \ libc-client2007e \ + libc-client-dev \ + libc-client2007e-dev \ # Dev and headers libavif-dev \ libjpeg62-turbo-dev \ libwebp-dev \ - libfreetype6-dev \ + libfreetype-dev \ libbz2-dev \ libicu-dev \ libldap2-dev \ @@ -127,8 +131,6 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libpng-dev \ libpq-dev \ libzip-dev \ - libc-client-dev \ - libc-client2007e-dev \ libkrb5-dev \ libvips-dev \ librabbitmq-dev \ @@ -136,6 +138,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libgmp-dev \ libyaml-dev \ libssl-dev \ + libonig-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ && unzip master.zip \ @@ -205,6 +208,8 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin && phpize && ./configure --enable-protobuf \ && make -j"$(nproc)" && make install \ && cd / && rm -rf /tmp/protobuf /tmp/protobuf.tar.gz \ + # Vips and XML-RPC are only built up to PHP 8.5: both are abandoned upstream and + # do not build against PHP 8.6. # Vips' GitHub tags lag behind PECL releases; use the upstream branch. && git clone --depth 1 https://github.com/libvips/php-vips-ext.git /tmp/vips \ && cd /tmp/vips \ @@ -223,8 +228,8 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin && echo extension=redis.so > /usr/local/etc/php/conf.d/redis.ini \ && echo extension=mongodb.so > /usr/local/etc/php/conf.d/mongodb.ini \ && echo extension=memcached.so > /usr/local/etc/php/conf.d/memcached.ini \ - && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ && echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \ + && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ && echo extension=xmlrpc.so > /usr/local/etc/php/conf.d/xmlrpc.ini \ # Uninstall dev and header packages && apt-get purge -y -f --force-yes \ @@ -250,6 +255,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libgmp-dev \ libyaml-dev \ libssl-dev \ + libonig-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ diff --git a/docker/php-official/8.2/conf/provision/bootstrap.d/30-setup-ioncube.sh b/docker/php-official/8.2/conf/provision/bootstrap.d/30-setup-ioncube.sh index 59a2d4245..8d15159dc 100644 --- a/docker/php-official/8.2/conf/provision/bootstrap.d/30-setup-ioncube.sh +++ b/docker/php-official/8.2/conf/provision/bootstrap.d/30-setup-ioncube.sh @@ -5,6 +5,13 @@ if [ $IMAGE_FAMILY == "Alpine" ]; then return fi +# The official PHP images are thread safe (ZTS) since PHP 8.6 and are built without +# Zend signals, which the ionCube ZTS loader needs (undefined zend_signal_globals_offset) +if [[ "$(php -n -r 'echo PHP_ZTS;')" == "1" ]]; then + echo "Skipping ionCube installation: the ionCube loader does not support this thread-safe PHP build" + return +fi + echo "Installing ionCube loader" case "$(uname -m)" in diff --git a/docker/php-official/8.3-alpine/Dockerfile b/docker/php-official/8.3-alpine/Dockerfile index e989c59c6..d8da4fcf0 100644 --- a/docker/php-official/8.3-alpine/Dockerfile +++ b/docker/php-official/8.3-alpine/Dockerfile @@ -106,6 +106,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libzip \ libmemcached \ yaml \ + oniguruma \ # Build dependencies linux-headers \ autoconf \ @@ -135,6 +136,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libzip-dev \ libmemcached-dev \ yaml-dev \ + oniguruma-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ && unzip master.zip \ @@ -206,6 +208,8 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin && phpize && ./configure --enable-protobuf \ && make -j"$(nproc)" && make install \ && cd / && rm -rf /tmp/protobuf /tmp/protobuf.tar.gz \ + # Vips and XML-RPC are only built up to PHP 8.5: both are abandoned upstream and + # do not build against PHP 8.6. # Vips' GitHub tags lag behind PECL releases; use the upstream branch. && git clone --depth 1 https://github.com/libvips/php-vips-ext.git /tmp/vips \ && cd /tmp/vips \ @@ -222,13 +226,13 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin excimer \ opentelemetry \ protobuf \ - vips \ yaml \ redis \ - xmlrpc \ imagick \ mongodb \ memcached \ + vips \ + xmlrpc \ # Uninstall dev and header packages && apk del -f --purge \ autoconf \ @@ -259,6 +263,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libzip-dev \ libmemcached-dev \ yaml-dev \ + oniguruma-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ diff --git a/docker/php-official/8.3-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh b/docker/php-official/8.3-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh index 59a2d4245..8d15159dc 100644 --- a/docker/php-official/8.3-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh +++ b/docker/php-official/8.3-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh @@ -5,6 +5,13 @@ if [ $IMAGE_FAMILY == "Alpine" ]; then return fi +# The official PHP images are thread safe (ZTS) since PHP 8.6 and are built without +# Zend signals, which the ionCube ZTS loader needs (undefined zend_signal_globals_offset) +if [[ "$(php -n -r 'echo PHP_ZTS;')" == "1" ]]; then + echo "Skipping ionCube installation: the ionCube loader does not support this thread-safe PHP build" + return +fi + echo "Installing ionCube loader" case "$(uname -m)" in diff --git a/docker/php-official/8.3/Dockerfile b/docker/php-official/8.3/Dockerfile index ad2833860..cbd2090de 100644 --- a/docker/php-official/8.3/Dockerfile +++ b/docker/php-official/8.3/Dockerfile @@ -71,7 +71,7 @@ RUN set -x \ unzip \ bzip2 \ moreutils \ - dnsutils \ + bind9-dnsutils \ openssh-client \ rsync \ git \ @@ -99,22 +99,26 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Libraries libavif15 \ libvips42 \ - librabbitmq4 \ libldap-2.5-0 \ + libpng16-16 \ + libzip4 \ + libmemcached11 \ + librabbitmq4 \ libxslt1.1 \ libldap-common \ zlib1g \ libpq5 \ - libpng16-16 \ libmcrypt4 \ - libzip4 \ libyaml-0-2 \ + libonig5 \ libc-client2007e \ + libc-client-dev \ + libc-client2007e-dev \ # Dev and headers libavif-dev \ libjpeg62-turbo-dev \ libwebp-dev \ - libfreetype6-dev \ + libfreetype-dev \ libbz2-dev \ libicu-dev \ libldap2-dev \ @@ -127,8 +131,6 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libpng-dev \ libpq-dev \ libzip-dev \ - libc-client-dev \ - libc-client2007e-dev \ libkrb5-dev \ libvips-dev \ librabbitmq-dev \ @@ -136,6 +138,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libgmp-dev \ libyaml-dev \ libssl-dev \ + libonig-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ && unzip master.zip \ @@ -205,6 +208,8 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin && phpize && ./configure --enable-protobuf \ && make -j"$(nproc)" && make install \ && cd / && rm -rf /tmp/protobuf /tmp/protobuf.tar.gz \ + # Vips and XML-RPC are only built up to PHP 8.5: both are abandoned upstream and + # do not build against PHP 8.6. # Vips' GitHub tags lag behind PECL releases; use the upstream branch. && git clone --depth 1 https://github.com/libvips/php-vips-ext.git /tmp/vips \ && cd /tmp/vips \ @@ -223,8 +228,8 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin && echo extension=redis.so > /usr/local/etc/php/conf.d/redis.ini \ && echo extension=mongodb.so > /usr/local/etc/php/conf.d/mongodb.ini \ && echo extension=memcached.so > /usr/local/etc/php/conf.d/memcached.ini \ - && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ && echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \ + && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ && echo extension=xmlrpc.so > /usr/local/etc/php/conf.d/xmlrpc.ini \ # Uninstall dev and header packages && apt-get purge -y -f --force-yes \ @@ -250,6 +255,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libgmp-dev \ libyaml-dev \ libssl-dev \ + libonig-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ diff --git a/docker/php-official/8.3/conf/provision/bootstrap.d/30-setup-ioncube.sh b/docker/php-official/8.3/conf/provision/bootstrap.d/30-setup-ioncube.sh index 59a2d4245..8d15159dc 100644 --- a/docker/php-official/8.3/conf/provision/bootstrap.d/30-setup-ioncube.sh +++ b/docker/php-official/8.3/conf/provision/bootstrap.d/30-setup-ioncube.sh @@ -5,6 +5,13 @@ if [ $IMAGE_FAMILY == "Alpine" ]; then return fi +# The official PHP images are thread safe (ZTS) since PHP 8.6 and are built without +# Zend signals, which the ionCube ZTS loader needs (undefined zend_signal_globals_offset) +if [[ "$(php -n -r 'echo PHP_ZTS;')" == "1" ]]; then + echo "Skipping ionCube installation: the ionCube loader does not support this thread-safe PHP build" + return +fi + echo "Installing ionCube loader" case "$(uname -m)" in diff --git a/docker/php-official/8.4-alpine/Dockerfile b/docker/php-official/8.4-alpine/Dockerfile index 6ec47d926..1930c8cb4 100644 --- a/docker/php-official/8.4-alpine/Dockerfile +++ b/docker/php-official/8.4-alpine/Dockerfile @@ -106,6 +106,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libzip \ libmemcached \ yaml \ + oniguruma \ # Build dependencies linux-headers \ autoconf \ @@ -135,6 +136,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libzip-dev \ libmemcached-dev \ yaml-dev \ + oniguruma-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ && unzip master.zip \ @@ -204,6 +206,8 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin && phpize && ./configure --enable-protobuf \ && make -j"$(nproc)" && make install \ && cd / && rm -rf /tmp/protobuf /tmp/protobuf.tar.gz \ + # Vips and XML-RPC are only built up to PHP 8.5: both are abandoned upstream and + # do not build against PHP 8.6. # Vips' GitHub tags lag behind PECL releases; use the upstream branch. && git clone --depth 1 https://github.com/libvips/php-vips-ext.git /tmp/vips \ && cd /tmp/vips \ @@ -220,13 +224,13 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin excimer \ opentelemetry \ protobuf \ - vips \ yaml \ redis \ - xmlrpc \ imagick \ mongodb \ memcached \ + vips \ + xmlrpc \ # Uninstall dev and header packages && apk del -f --purge \ autoconf \ @@ -257,6 +261,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libzip-dev \ libmemcached-dev \ yaml-dev \ + oniguruma-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ diff --git a/docker/php-official/8.4-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh b/docker/php-official/8.4-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh index 59a2d4245..8d15159dc 100644 --- a/docker/php-official/8.4-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh +++ b/docker/php-official/8.4-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh @@ -5,6 +5,13 @@ if [ $IMAGE_FAMILY == "Alpine" ]; then return fi +# The official PHP images are thread safe (ZTS) since PHP 8.6 and are built without +# Zend signals, which the ionCube ZTS loader needs (undefined zend_signal_globals_offset) +if [[ "$(php -n -r 'echo PHP_ZTS;')" == "1" ]]; then + echo "Skipping ionCube installation: the ionCube loader does not support this thread-safe PHP build" + return +fi + echo "Installing ionCube loader" case "$(uname -m)" in diff --git a/docker/php-official/8.4/Dockerfile b/docker/php-official/8.4/Dockerfile index 9e3cf5143..f62e0bab5 100644 --- a/docker/php-official/8.4/Dockerfile +++ b/docker/php-official/8.4/Dockerfile @@ -71,7 +71,7 @@ RUN set -x \ unzip \ bzip2 \ moreutils \ - dnsutils \ + bind9-dnsutils \ openssh-client \ rsync \ git \ @@ -99,21 +99,23 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Libraries libavif15 \ libvips42 \ - librabbitmq4 \ libldap-2.5-0 \ + libpng16-16 \ + libzip4 \ + libmemcached11 \ + librabbitmq4 \ libxslt1.1 \ libldap-common \ zlib1g \ libpq5 \ - libpng16-16 \ libmcrypt4 \ - libzip4 \ libyaml-0-2 \ + libonig5 \ # Dev and headers libavif-dev \ libjpeg62-turbo-dev \ libwebp-dev \ - libfreetype6-dev \ + libfreetype-dev \ libbz2-dev \ libicu-dev \ libldap2-dev \ @@ -126,8 +128,6 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libpng-dev \ libpq-dev \ libzip-dev \ - libc-client-dev \ - libc-client2007e-dev \ libkrb5-dev \ libvips-dev \ librabbitmq-dev \ @@ -135,6 +135,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libgmp-dev \ libyaml-dev \ libssl-dev \ + libonig-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ && unzip master.zip \ @@ -202,6 +203,8 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin && phpize && ./configure --enable-protobuf \ && make -j"$(nproc)" && make install \ && cd / && rm -rf /tmp/protobuf /tmp/protobuf.tar.gz \ + # Vips and XML-RPC are only built up to PHP 8.5: both are abandoned upstream and + # do not build against PHP 8.6. # Vips' GitHub tags lag behind PECL releases; use the upstream branch. && git clone --depth 1 https://github.com/libvips/php-vips-ext.git /tmp/vips \ && cd /tmp/vips \ @@ -220,13 +223,11 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin && echo extension=redis.so > /usr/local/etc/php/conf.d/redis.ini \ && echo extension=mongodb.so > /usr/local/etc/php/conf.d/mongodb.ini \ && echo extension=memcached.so > /usr/local/etc/php/conf.d/memcached.ini \ - && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ && echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \ + && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ && echo extension=xmlrpc.so > /usr/local/etc/php/conf.d/xmlrpc.ini \ # Uninstall dev and header packages && apt-get purge -y -f --force-yes \ - libc-client-dev \ - libc-client2007e-dev \ libkrb5-dev \ libbz2-dev \ libavif-dev \ @@ -247,6 +248,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libgmp-dev \ libyaml-dev \ libssl-dev \ + libonig-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ diff --git a/docker/php-official/8.4/conf/provision/bootstrap.d/30-setup-ioncube.sh b/docker/php-official/8.4/conf/provision/bootstrap.d/30-setup-ioncube.sh index 59a2d4245..8d15159dc 100644 --- a/docker/php-official/8.4/conf/provision/bootstrap.d/30-setup-ioncube.sh +++ b/docker/php-official/8.4/conf/provision/bootstrap.d/30-setup-ioncube.sh @@ -5,6 +5,13 @@ if [ $IMAGE_FAMILY == "Alpine" ]; then return fi +# The official PHP images are thread safe (ZTS) since PHP 8.6 and are built without +# Zend signals, which the ionCube ZTS loader needs (undefined zend_signal_globals_offset) +if [[ "$(php -n -r 'echo PHP_ZTS;')" == "1" ]]; then + echo "Skipping ionCube installation: the ionCube loader does not support this thread-safe PHP build" + return +fi + echo "Installing ionCube loader" case "$(uname -m)" in diff --git a/docker/php-official/8.5-alpine/Dockerfile b/docker/php-official/8.5-alpine/Dockerfile index 42b25e8e2..116116646 100644 --- a/docker/php-official/8.5-alpine/Dockerfile +++ b/docker/php-official/8.5-alpine/Dockerfile @@ -106,6 +106,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libzip \ libmemcached \ yaml \ + oniguruma \ # Build dependencies linux-headers \ autoconf \ @@ -135,6 +136,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libzip-dev \ libmemcached-dev \ yaml-dev \ + oniguruma-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ && unzip master.zip \ @@ -203,6 +205,8 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin && phpize && ./configure --enable-protobuf \ && make -j"$(nproc)" && make install \ && cd / && rm -rf /tmp/protobuf /tmp/protobuf.tar.gz \ + # Vips and XML-RPC are only built up to PHP 8.5: both are abandoned upstream and + # do not build against PHP 8.6. # Vips' GitHub tags lag behind PECL releases; use the upstream branch. && git clone --depth 1 https://github.com/libvips/php-vips-ext.git /tmp/vips \ && cd /tmp/vips \ @@ -219,13 +223,13 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin excimer \ opentelemetry \ protobuf \ - vips \ yaml \ redis \ - xmlrpc \ imagick \ mongodb \ memcached \ + vips \ + xmlrpc \ # Uninstall dev and header packages && apk del -f --purge \ autoconf \ @@ -256,6 +260,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libzip-dev \ libmemcached-dev \ yaml-dev \ + oniguruma-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ diff --git a/docker/php-official/8.5-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh b/docker/php-official/8.5-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh index 59a2d4245..8d15159dc 100644 --- a/docker/php-official/8.5-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh +++ b/docker/php-official/8.5-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh @@ -5,6 +5,13 @@ if [ $IMAGE_FAMILY == "Alpine" ]; then return fi +# The official PHP images are thread safe (ZTS) since PHP 8.6 and are built without +# Zend signals, which the ionCube ZTS loader needs (undefined zend_signal_globals_offset) +if [[ "$(php -n -r 'echo PHP_ZTS;')" == "1" ]]; then + echo "Skipping ionCube installation: the ionCube loader does not support this thread-safe PHP build" + return +fi + echo "Installing ionCube loader" case "$(uname -m)" in diff --git a/docker/php-official/8.5/Dockerfile b/docker/php-official/8.5/Dockerfile index 79bbedd6c..0b76f081c 100644 --- a/docker/php-official/8.5/Dockerfile +++ b/docker/php-official/8.5/Dockerfile @@ -71,7 +71,7 @@ RUN set -x \ unzip \ bzip2 \ moreutils \ - dnsutils \ + bind9-dnsutils \ openssh-client \ rsync \ git \ @@ -99,21 +99,23 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin # Libraries libavif15 \ libvips42 \ - librabbitmq4 \ libldap-2.5-0 \ + libpng16-16 \ + libzip4 \ + libmemcached11 \ + librabbitmq4 \ libxslt1.1 \ libldap-common \ zlib1g \ libpq5 \ - libpng16-16 \ libmcrypt4 \ - libzip4 \ libyaml-0-2 \ + libonig5 \ # Dev and headers libavif-dev \ libjpeg62-turbo-dev \ libwebp-dev \ - libfreetype6-dev \ + libfreetype-dev \ libbz2-dev \ libicu-dev \ libldap2-dev \ @@ -126,8 +128,6 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libpng-dev \ libpq-dev \ libzip-dev \ - libc-client-dev \ - libc-client2007e-dev \ libkrb5-dev \ libvips-dev \ librabbitmq-dev \ @@ -135,6 +135,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libgmp-dev \ libyaml-dev \ libssl-dev \ + libonig-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ && unzip master.zip \ @@ -201,6 +202,8 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin && phpize && ./configure --enable-protobuf \ && make -j"$(nproc)" && make install \ && cd / && rm -rf /tmp/protobuf /tmp/protobuf.tar.gz \ + # Vips and XML-RPC are only built up to PHP 8.5: both are abandoned upstream and + # do not build against PHP 8.6. # Vips' GitHub tags lag behind PECL releases; use the upstream branch. && git clone --depth 1 https://github.com/libvips/php-vips-ext.git /tmp/vips \ && cd /tmp/vips \ @@ -219,13 +222,11 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin && echo extension=redis.so > /usr/local/etc/php/conf.d/redis.ini \ && echo extension=mongodb.so > /usr/local/etc/php/conf.d/mongodb.ini \ && echo extension=memcached.so > /usr/local/etc/php/conf.d/memcached.ini \ - && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ && echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \ + && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ && echo extension=xmlrpc.so > /usr/local/etc/php/conf.d/xmlrpc.ini \ # Uninstall dev and header packages && apt-get purge -y -f --force-yes \ - libc-client-dev \ - libc-client2007e-dev \ libkrb5-dev \ libbz2-dev \ libavif-dev \ @@ -246,6 +247,7 @@ RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin libgmp-dev \ libyaml-dev \ libssl-dev \ + libonig-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ diff --git a/docker/php-official/8.5/conf/provision/bootstrap.d/30-setup-ioncube.sh b/docker/php-official/8.5/conf/provision/bootstrap.d/30-setup-ioncube.sh index 59a2d4245..8d15159dc 100644 --- a/docker/php-official/8.5/conf/provision/bootstrap.d/30-setup-ioncube.sh +++ b/docker/php-official/8.5/conf/provision/bootstrap.d/30-setup-ioncube.sh @@ -5,6 +5,13 @@ if [ $IMAGE_FAMILY == "Alpine" ]; then return fi +# The official PHP images are thread safe (ZTS) since PHP 8.6 and are built without +# Zend signals, which the ionCube ZTS loader needs (undefined zend_signal_globals_offset) +if [[ "$(php -n -r 'echo PHP_ZTS;')" == "1" ]]; then + echo "Skipping ionCube installation: the ionCube loader does not support this thread-safe PHP build" + return +fi + echo "Installing ionCube loader" case "$(uname -m)" in diff --git a/docker/php-official/8.6-alpine/Dockerfile b/docker/php-official/8.6-alpine/Dockerfile new file mode 100644 index 000000000..1dfd0f963 --- /dev/null +++ b/docker/php-official/8.6-alpine/Dockerfile @@ -0,0 +1,272 @@ +#+++++++++++++++++++++++++++++++++++++++ +# Dockerfile for webdevops/php-official:8.6-alpine +# -- automatically generated -- +#+++++++++++++++++++++++++++++++++++++++ + + +FROM php:8.6-rc-fpm-alpine + +LABEL maintainer=info@webdevops.io \ + vendor=WebDevOps.io \ + io.webdevops.layout=8 \ + io.webdevops.version=1.5.0 + +ENV TERM="xterm" \ + LANG="C.UTF-8" \ + LC_ALL="C.UTF-8" +ENV DOCKER_CONF_HOME=/opt/docker/ \ + LOG_STDOUT="" \ + LOG_STDERR="" +ENV APPLICATION_USER=application \ + APPLICATION_GROUP=application \ + APPLICATION_PATH=/app \ + APPLICATION_UID=1000 \ + APPLICATION_GID=1000 +ENV PHP_SENDMAIL_PATH="/usr/sbin/sendmail -t -i" +ENV LD_PRELOAD="/usr/lib/preloadable_libiconv.so" +ENV COMPOSER_VERSION="2" + + +# Baselayout copy (from staged image) +COPY --from=webdevops/toolbox /baselayout/sbin/* /sbin/ +COPY --from=webdevops/toolbox /baselayout/usr/local/bin/* /usr/local/bin/ + + +COPY conf/ /opt/docker/ + +RUN set -x \ + # Init bootstrap + # Add community + && echo https://dl-4.alpinelinux.org/alpine/v3.20/community/ >> /etc/apk/repositories \ + # System update + && /usr/local/bin/apk-upgrade \ + # Install base stuff + && apk-install \ + bash \ + ca-certificates \ + openssl \ + && update-ca-certificates \ + && /usr/local/bin/generate-dockerimage-info \ + ## Fix su execution (eg for tests) + && mkdir -p /etc/pam.d/ \ + && echo 'auth sufficient pam_rootok.so' >> /etc/pam.d/su + +RUN set -x \ + # Install services + && chmod +x /opt/docker/bin/* \ + && apk-install \ + supervisor \ + wget \ + curl \ + vim \ + sed \ + tzdata \ + busybox-suid \ + && chmod +s /sbin/gosu \ + && docker-run-bootstrap + +RUN set -x \ + && apk-install shadow \ + && apk-install \ + # Install common tools + zip \ + unzip \ + bzip2 \ + drill \ + ldns \ + openssh-client \ + rsync \ + patch \ + git \ + && docker-run-bootstrap + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + # Install php environment + && apk-install \ + file \ + imagemagick \ + graphicsmagick \ + ghostscript \ + jpegoptim \ + pngcrush \ + optipng \ + pngquant \ + vips \ + rabbitmq-c \ + c-client \ + # Libraries + libavif \ + libldap \ + icu-libs \ + libintl \ + libpq \ + libxslt \ + libgomp \ + libzip \ + libmemcached \ + yaml \ + oniguruma \ + # Build dependencies + linux-headers \ + autoconf \ + g++ \ + make \ + libtool \ + pcre-dev \ + gettext-dev \ + libavif-dev \ + freetype-dev \ + gmp-dev \ + libjpeg-turbo-dev \ + libpng-dev \ + vips-dev \ + krb5-dev \ + openssl-dev \ + imap-dev \ + imagemagick-dev \ + rabbitmq-c-dev \ + openldap-dev \ + icu-dev \ + postgresql-dev \ + libxml2-dev \ + samba-dev \ + pcre-dev \ + libxslt-dev \ + libzip-dev \ + libmemcached-dev \ + yaml-dev \ + oniguruma-dev \ + # Install guetzli + && wget https://github.com/google/guetzli/archive/master.zip \ + && unzip master.zip \ + && make -C guetzli-master \ + && cp guetzli-master/bin/Release/guetzli /usr/local/bin/ \ + && rm -rf master.zip guetzli-master \ + # https://github.com/docker-library/php/issues/240 + && apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted \ + # Install new version of ICU + && curl -sS -o /tmp/icu.tar.gz -L https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz \ + && tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make -j"$(nproc)" && make install && cd / && rm -rf /tmp/icu* \ + # Install extensions + && PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \ + && docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \ + && git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \ + && git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \ + # TODO PHP 8.6: php-amqp has no release supporting PHP 8.6 yet; build the + # unmerged upstream fix https://github.com/php-amqp/php-amqp/pull/638 (pinned commit) + && cd /usr/src/php/ext/amqp \ + && git fetch --depth 1 origin 58edfb5e51a49cd10174cdfb18c73a539892d53d \ + && git checkout -q FETCH_HEAD \ + && git submodule update --init \ + && docker-php-ext-configure ldap \ + && docker-php-ext-configure ftp --with-ftp-ssl \ + && docker-php-ext-install -j"$(nproc)" \ + bcmath \ + bz2 \ + calendar \ + exif \ + ftp \ + gmp \ + ffi \ + imagick \ + amqp \ + intl \ + gettext \ + ldap \ + mysqli \ + mbstring \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + soap \ + sockets \ + sysvmsg \ + sysvsem \ + sysvshm \ + shmop \ + xsl \ + zip \ + gd \ + && cd / \ + && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ + --skip-enable-extension --make-parallel-jobs="$(nproc)" \ + # TODO PHP 8.6: the PHP 8.6 fixes of these extensions are merged upstream but not + # released yet; build their development branches until a release supports PHP 8.6 + "apcu/apcu:dev-master" \ + "wikimedia/excimer:dev-master" \ + open-telemetry/ext-opentelemetry \ + "php-memcached/php-memcached:dev-master" \ + "pecl/yaml:dev-php7" \ + "phpredis/phpredis:dev-develop" \ + mongodb/mongodb-extension \ + && rm -rf /tmp/pie \ + && PROTOBUF_RELEASE_URL="$(curl -fsSLI --proto '=https' --proto-redir '=https' --retry 3 -o /dev/null -w '%{url_effective}' https://github.com/protocolbuffers/protobuf/releases/latest)" \ + && PROTOBUF_VERSION="${PROTOBUF_RELEASE_URL##*/}" \ + && mkdir -p /tmp/protobuf \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 "https://codeload.github.com/protocolbuffers/protobuf/tar.gz/refs/tags/${PROTOBUF_VERSION}" -o /tmp/protobuf.tar.gz \ + && tar -xzf /tmp/protobuf.tar.gz --strip-components=1 -C /tmp/protobuf \ + && cd /tmp/protobuf/php/ext/google/protobuf \ + && mkdir -p third_party \ + && cp -R /tmp/protobuf/third_party/utf8_range third_party/ \ + # TODO PHP 8.6: protobuf still calls the zval_dtor() alias removed in PHP 8.6 + # https://github.com/protocolbuffers/protobuf/issues/29723 + && grep -rl 'zval_dtor(' . | xargs -r sed -i 's/\([^_a-z]\)zval_dtor(/\1zval_ptr_dtor_nogc(/g' \ + && phpize && ./configure --enable-protobuf \ + && make -j"$(nproc)" && make install \ + && cd / && rm -rf /tmp/protobuf /tmp/protobuf.tar.gz \ + && docker-php-ext-enable \ + apcu \ + excimer \ + opentelemetry \ + protobuf \ + yaml \ + redis \ + imagick \ + mongodb \ + memcached \ + # Uninstall dev and header packages + && apk del -f --purge \ + autoconf \ + linux-headers \ + g++ \ + make \ + libtool \ + pcre-dev \ + gettext-dev \ + libavif-dev \ + freetype-dev \ + gmp-dev \ + libjpeg-turbo-dev \ + libpng-dev \ + vips-dev \ + krb5-dev \ + openssl-dev \ + imap-dev \ + rabbitmq-c-dev \ + imagemagick-dev \ + openldap-dev \ + icu-dev \ + postgresql-dev \ + libxml2-dev \ + samba-dev \ + pcre-dev \ + libxslt-dev \ + libzip-dev \ + libmemcached-dev \ + yaml-dev \ + oniguruma-dev \ + && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ + && ln -sf /usr/local/bin/composer2 /usr/local/bin/composer \ + # Enable php services + && docker-service enable syslog \ + && docker-service enable cron \ + && docker-run-bootstrap + +WORKDIR / +EXPOSE 9000 +ENTRYPOINT ["/entrypoint"] +CMD ["supervisord"] diff --git a/docker/php-official/8.6-alpine/Dockerfile.twig b/docker/php-official/8.6-alpine/Dockerfile.twig new file mode 100644 index 000000000..92e58e30e --- /dev/null +++ b/docker/php-official/8.6-alpine/Dockerfile.twig @@ -0,0 +1,45 @@ +{% import 'docker.twig' as docker %} +{% import 'provision.twig' as provision %} +{% import 'environment.twig' as environment %} +{% import 'baselayout.twig' as baselayout %} +{% import 'images/bootstrap.twig' as bootstrap %} +{% import 'images/base.twig' as base %} +{% import 'images/baseapp.twig' as baseapp %} +{% import 'images/php.twig' as php %} + +{{ docker.fromOfficial("php", "8.6-rc-fpm-alpine") }} + +{{ docker.version() }} + +{{ environment.general() }} +{{ environment.base() }} +{{ environment.baseApp() }} +{# Check if needed #} +{{ environment.phpOfficialSendmailWorkaround() }} +{{ environment.phpAlpineIconvWorkaround() }} +{{ environment.phpComposerVersion() }} + +{{ baselayout.copy() }} + +{{ docker.copy('conf/', '/opt/docker/') }} + +RUN set -x \ + {{ bootstrap.alpine('3.20') }} + +RUN set -x \ + {{ base.alpine() }} \ + {{ provision.runBootstrap() }} + +RUN set -x \ + {{ baseapp.alpine() }} \ + {{ provision.runBootstrap() }} + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + {{ php.officialAlpine(version='8.6') }} \ + {{ provision.runBootstrap() }} + +{{ docker.workdir('/') }} +{{ docker.expose('9000') }} +{{ docker.entrypoint("/entrypoint") }} +{{ docker.cmd("supervisord") }} diff --git a/docker/php-official/8.6-alpine/conf/VERSION b/docker/php-official/8.6-alpine/conf/VERSION new file mode 100644 index 000000000..301160a93 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/VERSION @@ -0,0 +1 @@ +8 \ No newline at end of file diff --git a/docker/php-official/8.6-alpine/conf/bin/bootstrap.sh b/docker/php-official/8.6-alpine/conf/bin/bootstrap.sh new file mode 100644 index 000000000..b1b3acdbc --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/bootstrap.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec docker-run-bootstrap diff --git a/docker/php-official/8.6-alpine/conf/bin/config.sh b/docker/php-official/8.6-alpine/conf/bin/config.sh new file mode 100644 index 000000000..46265a3c0 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/config.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash + +shopt -s nullglob + +### + # Check if current user is root + # + ## +function rootCheck() { + # Root check + if [ "$(/usr/bin/whoami)" != "root" ]; then + echo "[ERROR] $* must be run as root" + exit 1 + fi +} + +### + # Create /docker.stdout and /docker.stderr + # + ## +function createDockerStdoutStderr() { + # link stdout from docker + if [[ -n "$LOG_STDOUT" ]]; then + echo "Log stdout redirected to $LOG_STDOUT" + else + LOG_STDOUT="/proc/$$/fd/1" + fi + + if [[ -n "$LOG_STDERR" ]]; then + echo "Log stderr redirected to $LOG_STDERR" + else + LOG_STDERR="/proc/$$/fd/2" + fi + + ln -f -s "$LOG_STDOUT" /docker.stdout + ln -f -s "$LOG_STDERR" /docker.stderr +} +### + # Include script directory text inside a file + # + # $1 -> path + # + ## +function includeScriptDir() { + if [[ -d "$1" ]]; then + for FILE in "$1"/*.sh; do + echo "-> Executing ${FILE}" + # run custom scripts, only once + . "$FILE" + done + fi +} + +### + # Show deprecation notice + # + ## +function deprecationNotice() { + echo "" + echo "###############################################################################" + echo "### THIS CALL IS DEPRECATED AND WILL BE REMOVED IN THE FUTURE" + echo "###" + echo "### $*" + echo "###" + echo "###############################################################################" + echo "" +} + +### + # Run "entrypoint" scripts + ## +function runEntrypoints() { + ############### + # Try to find entrypoint + ############### + + ENTRYPOINT_SCRIPT="/opt/docker/bin/entrypoint.d/${TASK}.sh" + + if [ -f "$ENTRYPOINT_SCRIPT" ]; then + . "$ENTRYPOINT_SCRIPT" + fi + + ############### + # Run default + ############### + if [ -f "/opt/docker/bin/entrypoint.d/default.sh" ]; then + . /opt/docker/bin/entrypoint.d/default.sh + fi + + exit 1 +} + + # Run "entrypoint" provisioning + ## +function runProvisionEntrypoint() { + includeScriptDir "/opt/docker/provision/entrypoint.d" + includeScriptDir "/entrypoint.d" +} + +### + # List environment variables (based on prefix) + ## +function envListVars() { + if [[ $# -eq 1 ]]; then + env | grep "^${1}" | cut -d= -f1 + else + env | cut -d= -f1 + fi +} + +### + # Get environment variable (even with dots in name) + # + ## +function envGetValue() { + awk "BEGIN {print ENVIRON[\"$1\"]}" +} diff --git a/docker/php-official/8.6-alpine/conf/bin/control.sh b/docker/php-official/8.6-alpine/conf/bin/control.sh new file mode 100644 index 000000000..72111f395 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/control.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +source /opt/docker/bin/config.sh + +rootCheck "$0" + +CONTROL_COMMAND="$1" +shift + +case "$CONTROL_COMMAND" in + + ## ------------------------------------------ + ## Service + ## ------------------------------------------ + + "service.enable") + deprecationNotice " Please use >>docker-service-enable [service]<<" + docker-service-enable "$1" + ;; + + "service.disable") + deprecationNotice " Please use >>docker-service-disable [service]<<" + docker-service-disable "$1" + ;; + + ## ------------------------------------------ + ## Version + ## ------------------------------------------ + + "version.get") + cat /opt/docker/VERSION + ;; + + "version.require.min") + EXPECTED_VERSION="$1" + CURRENT_VERSION="$(cat /opt/docker/VERSION)" + if [ "$CURRENT_VERSION" -lt "$EXPECTED_VERSION" ]; then + echo "-----------------------------------------------------------" + echo "--- This docker image is not up2date!" + echo "--- " + echo "--- Version expected min: $EXPECTED_VERSION" + echo "--- Version current: $CURRENT_VERSION" + echo "--- " + echo "--- Run 'docker pull ' to update image" + echo "-----------------------------------------------------------" + exit 1 + fi + ;; + + "version.require.max") + EXPECTED_VERSION="$1" + CURRENT_VERSION="$(cat /opt/docker/VERSION)" + if [ "$CURRENT_VERSION" -gt "$EXPECTED_VERSION" ]; then + echo "-----------------------------------------------------------" + echo "--- This docker image is too new!" + echo "--- " + echo "--- Version expected max: $EXPECTED_VERSION" + echo "--- Version current: $CURRENT_VERSION" + echo "-----------------------------------------------------------" + exit 1 + fi + ;; + + + "buildtime.get") + cat /opt/docker/BUILDTIME + ;; + + *) + echo "[ERROR] Invalid controll command: \"${CONTROL_COMMAND}\"" + exit 1 + ;; +esac diff --git a/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/cli.sh b/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/cli.sh new file mode 100644 index 000000000..fe212a8ea --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/cli.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +############################################# +## Run CLI_SCRIPT from environment variable +############################################# + +if [ -n "${CLI_SCRIPT}" ]; then + if [ -n "$APPLICATION_USER" ]; then + # Run as EFFECTIVE_USER + shift + exec gosu "${APPLICATION_USER}" ${CLI_SCRIPT} "$@" + else + # Run as root + exec ${CLI_SCRIPT} "$@" + fi +else + echo "[ERROR] No CLI_SCRIPT in in docker environment defined" + exit 1 +fi diff --git a/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/default.sh b/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/default.sh new file mode 100644 index 000000000..a1be715fe --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/default.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec "$@" diff --git a/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/noop.sh b/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/noop.sh new file mode 100644 index 000000000..092d55d8b --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/noop.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +############################################# +## NOOP (no operation) +############################################# + +exec tail -f /dev/null diff --git a/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/root.sh b/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/root.sh new file mode 100644 index 000000000..6fa0d063e --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/root.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +############################################# +## Root shell +############################################# + +if [ "$#" -eq 1 ]; then + ## No command, fall back to interactive shell + exec bash +else + ## Exec root command + shift + exec "$@" +fi diff --git a/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/supervisord.sh b/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/supervisord.sh new file mode 100644 index 000000000..f21489667 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/entrypoint.d/supervisord.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +############################################# +## Supervisord (start daemons) +############################################# + +## Start services +exec /opt/docker/bin/service.d/supervisor.sh + diff --git a/docker/php-official/8.6-alpine/conf/bin/entrypoint.sh b/docker/php-official/8.6-alpine/conf/bin/entrypoint.sh new file mode 100644 index 000000000..0489b796c --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/entrypoint.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +if [[ -z "$CONTAINER_UID" ]]; then + export CONTAINER_UID="application" +fi + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +# auto elevate privileges (if container is not started as root) +if [[ "$UID" -ne 0 ]]; then + export CONTAINER_UID="$UID" + exec gosu root "$0" "$@" +fi +# remove suid bit on gosu +chmod -s /sbin/gosu + +trap 'echo sigterm ; exit' SIGTERM +trap 'echo sigkill ; exit' SIGKILL + +# sanitize input and set task +TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" + +source /opt/docker/bin/config.sh + +createDockerStdoutStderr + +if [[ "$UID" -eq 0 ]]; then + # Only run provision if user is root + + if [ "$TASK" == "supervisord" -o "$TASK" == "noop" ]; then + # Visible provisioning + runProvisionEntrypoint + else + # Hidden provisioning + runProvisionEntrypoint > /dev/null + fi +fi + +############################# +## COMMAND +############################# + +runEntrypoints "$@" diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/cron.d/10-init.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/cron.d/10-init.sh new file mode 100644 index 000000000..611edc9bf --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/cron.d/10-init.sh @@ -0,0 +1,16 @@ +# Install crontab files + +if [[ -d "/opt/docker/etc/cron" ]]; then + mkdir -p /etc/cron.d/ + + find /opt/docker/etc/cron -type f | while read CRONTAB_FILE; do + # fix permissions + chmod 0644 -- "$CRONTAB_FILE" + + # add newline, cron needs this + echo >> "$CRONTAB_FILE" + + # Install files + cp -a -- "$CRONTAB_FILE" "/etc/cron.d/$(basename "$CRONTAB_FILE")" + done +fi diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/cron.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/cron.sh new file mode 100644 index 000000000..5af135768 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/cron.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_CRON_OPTS" ]]; then SERVICE_CRON_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/cron.d/" + +exec /usr/sbin/crond -f $SERVICE_CRON_OPTS diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/dnsmasq.d/10-init.sh new file mode 100644 index 000000000..836ebe2b5 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -0,0 +1,37 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + +# Enable /etc/dnsmasq.d/ +go-replace --mode=lineinfile --once \ + -s 'conf-dir' -r 'conf-dir=/etc/dnsmasq.d/,*.conf' \ + -- /etc/dnsmasq.conf + +## clear dns file +echo > /etc/dnsmasq.d/webdevops.conf + +if [ ! -f /etc/resolv.conf.original ]; then + cp -a /etc/resolv.conf /etc/resolv.conf.original + + ## set forward servers + cat /etc/resolv.conf.original | grep nameserver | sed 's/nameserver /server=/' > /etc/dnsmasq.d/forward.conf + + ## set dnsmasq to main nameserver + echo "nameserver 127.0.0.1" > /etc/resolv.conf +fi + + +# Add own VIRTUAL_HOST as loopback +if [[ -n "${VIRTUAL_HOST+x}" ]]; then + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops.conf + done +fi diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/dnsmasq.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/dnsmasq.sh new file mode 100644 index 000000000..b8b4c12e0 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/dnsmasq.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_DNSMASQ_OPTS" ]]; then SERVICE_DNSMASQ_OPTS=""; fi +if [[ -z "$SERVICE_DNSMASQ_USER" ]]; then SERVICE_DNSMASQ_USER="root"; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/dnsmasq.d/" + +exec dnsmasq --keep-in-foreground --user="$SERVICE_DNSMASQ_USER" $SERVICE_DNSMASQ_OPTS diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/php-fpm.d/10-init.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/php-fpm.d/10-init.sh new file mode 100644 index 000000000..7d0dadad6 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/php-fpm.d/10-init.sh @@ -0,0 +1,12 @@ +# setup user env +FPM_POOL_CONF="/opt/docker/etc/php/fpm/pool.d/application.conf" + +## Setup container uid +if [[ -n "$CONTAINER_UID" ]]; then + echo "Setting php-fpm user to $CONTAINER_UID" + go-replace --mode=line --regex \ + -s '^[\s;]*user[\s]*=' -r "user = $CONTAINER_UID" \ + -s '^[\s;]*group[\s]*=' -r "group = $CONTAINER_UID" \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' +fi diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/php-fpm.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/php-fpm.sh new file mode 100644 index 000000000..15374f566 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/php-fpm.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_PHPFPM_OPTS" ]]; then SERVICE_PHPFPM_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/php-fpm.d/" + +exec /usr/local/bin/php-fpm --nodaemonize $SERVICE_PHPFPM_OPTS diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/postfix.d/10-init.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/postfix.d/10-init.sh new file mode 100644 index 000000000..82574153d --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/postfix.d/10-init.sh @@ -0,0 +1,30 @@ +# force new copy of hosts there (otherwise links could be outdated) +mkdir -p /var/spool/postfix/etc +cp -f /etc/hosts /var/spool/postfix/etc/hosts +cp -f /etc/resolv.conf /var/spool/postfix/etc/resolv.conf +cp -f /etc/services /var/spool/postfix/etc/services + +go-replace --mode=line --regex -s '^[\s]*myhostname[\s]*=.*' -r "myhostname = $HOSTNAME" + +# General +go-replace --mode=lineinfile --regex \ + -s '^[\s]*myhostname[\s]*=.*.*' -r "myhostname = $HOSTNAME" \ + -s '^[\s]*inet_interfaces[\s]*=.*' -r "inet_interfaces = 127.0.0.1" \ + -- /etc/postfix/main.cf + +## REPLAYHOST +if [[ -n "${POSTFIX_RELAYHOST+x}" ]]; then + go-replace --mode=lineinfile --regex \ + -s '^[\s]*relayhost[\s]*=.*' -r "relayhost = $POSTFIX_RELAYHOST" \ + -- /etc/postfix/main.cf +fi + +## MYNETWORKS +if [[ -n "${POSTFIX_MYNETWORKS+x}" ]]; then + go-replace --mode=lineinfile --regex \ + -s '^[\s]*mynetworks[\s]*=.*' -r "mynetworks = $POSTFIX_MYNETWORKS" \ + -- /etc/postfix/main.cf +fi + +# generate aliases db +newaliases || : diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/postfix.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/postfix.sh new file mode 100644 index 000000000..b9e477bcd --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/postfix.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# postfix-wrapper.sh, version 0.1.0 +# +# You cannot start postfix in some foreground mode and +# it's more or less important that docker doesn't kill +# postfix and its chilren if you stop the container. +# +# Use this script with supervisord and it will take +# care about starting and stopping postfix correctly. +# +# supervisord config snippet for postfix-wrapper: +# +# [program:postfix] +# process_name = postfix +# command = /path/to/postfix-wrapper.sh +# startsecs = 0 +# autorestart = false +# + +# Init vars +if [[ -z "$SERVICE_POSTFIX_OPTS" ]]; then SERVICE_POSTFIX_OPTS=""; fi + +source /opt/docker/bin/config.sh + +trap "postfix stop" SIGINT +trap "postfix stop" SIGTERM +trap "postfix reload" SIGHUP + +includeScriptDir "/opt/docker/bin/service.d/postfix.d/" + +# start postfix +postfix start $SERVICE_POSTFIX_OPTS + +# lets give postfix some time to start +sleep 3 + +# wait until postfix is dead (triggered by trap) +if [[ -f /var/spool/postfix/pid/master.pid ]]; then + while kill -0 "$(cat /var/spool/postfix/pid/master.pid 2>/dev/null)" &>/dev/null; do + sleep 5 + done +fi diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/ssh.d/10-init.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/ssh.d/10-init.sh new file mode 100644 index 000000000..f2b600312 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/ssh.d/10-init.sh @@ -0,0 +1,7 @@ +# Init ssh privilege separation directory +mkdir -p /var/run/sshd +chown root:root /var/run/sshd +chmod 755 /var/run/sshd + +# generate host keys +ssh-keygen -A diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/ssh.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/ssh.sh new file mode 100644 index 000000000..f01e87ab3 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/ssh.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_SSH_OPTS" ]]; then SERVICE_SSH_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/ssh.d/" + +exec /usr/sbin/sshd -D $SERVICE_SSH_OPTS diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/supervisor.d/10-init.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/supervisor.d/10-init.sh new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/supervisor.d/10-init.sh @@ -0,0 +1 @@ +# placeholder diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/supervisor.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/supervisor.sh new file mode 100644 index 000000000..5a82a13ff --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/supervisor.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_SUPERVISOR_OPTS" ]]; then SERVICE_SUPERVISOR_OPTS=""; fi +if [[ -z "$SERVICE_SUPERVISOR_USER" ]]; then SERVICE_SUPERVISOR_USER="root"; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/supervisor.d/" + +exec supervisord -c /opt/docker/etc/supervisor.conf --logfile /dev/null --pidfile /dev/null --user "$SERVICE_SUPERVISOR_USER" $SERVICE_SUPERVISOR_OPTS diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/syslog-ng.d/10-init.sh new file mode 100644 index 000000000..326207e52 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -0,0 +1,10 @@ +# If /dev/log is either a named pipe or it was placed there accidentally, +# e.g. because of the issue documented at https://github.com/phusion/baseimage-docker/pull/25, +# then we remove it. +if [ ! -S /dev/log ]; then rm -f /dev/log; fi +if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi + +if [[ ! -p /docker.stdout ]]; then + # Switch to file (tty docker mode) + go-replace -s 'pipe("/docker.stdout")' -r 'file("/docker.stdout")' -- /opt/docker/etc/syslog-ng/syslog-ng.conf +fi diff --git a/docker/php-official/8.6-alpine/conf/bin/service.d/syslog-ng.sh b/docker/php-official/8.6-alpine/conf/bin/service.d/syslog-ng.sh new file mode 100644 index 000000000..8e1358c1b --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/service.d/syslog-ng.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_SYSLOG_OPTS" ]]; then SERVICE_SYSLOG_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" + +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS $SERVICE_SYSLOG_OPTS diff --git a/docker/php-official/8.6-alpine/conf/bin/usr-bin/container-file-auto-restore b/docker/php-official/8.6-alpine/conf/bin/usr-bin/container-file-auto-restore new file mode 100644 index 000000000..a41fcb3c8 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/usr-bin/container-file-auto-restore @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +set -o pipefail ## trace ERR through pipes +set -o errtrace ## trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +if [[ "$#" -ne 1 ]]; then + echo "Usage: $0 " + exit 1 +fi + +SOURCE_FILE="$1" +BACKUP_FILE="$(dirname "$1")/.$(basename "$1").bak" + +if [[ -f "$BACKUP_FILE" ]]; then + ## Backup file exists + ## -> container was restarted + ## -> restoring configuration + cp -a -- "$BACKUP_FILE" "$SOURCE_FILE" +else + ## Backup file DOESN'T exists + ## -> container first startup + ## -> backup configuration + cp -a -- "$SOURCE_FILE" "$BACKUP_FILE" +fi diff --git a/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-cronjob b/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-cronjob new file mode 100644 index 000000000..2746c75f5 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-cronjob @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +source /opt/docker/bin/config.sh + +rootCheck "$0" + +if [[ "$#" -eq 0 ]]; then + echo "Usage: $0 ''" + exit 1 +fi + +# create crontab file +touch /etc/cron.d/webdevops-docker +chmod 0644 /etc/cron.d/webdevops-docker + +for CRONJOB_LINES in "$@"; do + echo "$CRONJOB_LINES" >> /etc/cron.d/webdevops-docker +done + +# Add required newline at end +echo >> /etc/cron.d/webdevops-docker diff --git a/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-php-setting b/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-php-setting new file mode 100644 index 000000000..30bbb979f --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-php-setting @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +# Defaults +PHP_INI_FILE="/opt/docker/etc/php/php.ini" +PHP_VALUE_RAW=0 +PHP_KEY= +PHP_VALUE= + +for arg in "$@"; do + case "$arg" in + --raw) + PHP_VALUE_RAW=1 + shift + ;; + esac +done + +if [[ "$#" -le 2 ]]; then + echo "Usage: $(basename "$0") [--raw] " + exit 1 +fi + +PHP_SETTING_KEY=$1 +shift +PHP_SETTING_VALUE="$@" + +if [[ "$PHP_VALUE_RAW" -eq 0 ]]; then + case "$PHP_SETTING_VALUE" in + ''|*[!0-9]*) + # non numeric + PHP_SETTING_VALUE="\"${PHP_SETTING_VALUE}\"" + ;; + esac +fi + + +echo "$(basename "$0"): Setting php setting: ${PHP_SETTING_KEY} = ${PHP_SETTING_VALUE}" +echo "${PHP_SETTING_KEY} = ${PHP_SETTING_VALUE}" >> "$PHP_INI_FILE" + diff --git a/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-service b/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-service new file mode 100644 index 000000000..70a493767 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-service @@ -0,0 +1,89 @@ +#!/usr/bin/env bash + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +if [[ "$#" -le 1 ]]; then + echo "Usage: $0 " + exit 1 +fi + +SERVICE_COMMAND=$1 +shift + +for SERVICE in "$@"; do + RUN_FILE="/opt/docker/bin/service.d/${SERVICE}.sh" + SERVICE_FILE="/opt/docker/etc/supervisor.d/${SERVICE}.conf" + PROVISION_FILE="/opt/docker/provision/service.d/${SERVICE}.sh" + + case "$SERVICE_COMMAND" in + enable) + # Run on demand installation/provisioning + if [[ -f "$PROVISION_FILE" ]]; then + echo "Running provisioning for ${SERVICE}, please wait..." + + ## execute scripts + . "$PROVISION_FILE" + + ## remove directory (one run time) + rm -f -- "$PROVISION_FILE" + fi + + ## Enable service + if [[ -f "$SERVICE_FILE" ]]; then + go-replace --mode=lineinfile \ + -s 'autostart =' -r 'autostart = true' \ + -- "$SERVICE_FILE" + else + echo "[ERROR] Service '${SERVICE}' not found (tried ${SERVICE_FILE})" + exit 1 + fi + ;; + + disable) + ## Disable service + if [[ -f "$SERVICE_FILE" ]]; then + go-replace --mode=lineinfile \ + -s 'autostart =' -r 'autostart = false' \ + -- "$SERVICE_FILE" + else + echo "[ERROR] Service '${SERVICE}' not found (tried ${SERVICE_FILE})" + exit 1 + fi + ;; + + install) + # Run on demand installation/provisioning + if [[ -f "$PROVISION_FILE" ]]; then + echo "Running provisioning for ${SERVICE}, please wait..." + + ## execute scripts + . "$PROVISION_FILE" + + ## remove directory (one run time) + rm -f -- "$PROVISION_FILE" + fi + ;; + + run) + if [[ -f "$RUN_FILE" ]]; then + exec "$RUN_FILE" + else + echo "[ERROR] Service '${SERVICE}' not found (tried ${RUN_FILE})" + exit 1 + fi + ;; + + stop|start|restart|status|pid|check) + service "${SERVICE}" "$SERVICE_COMMAND" + ;; + + *) + echo "[ERROR] $SERVICE_COMMAND is not a valid command" + exit 1 + ;; + esac +done + diff --git a/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-service-disable b/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-service-disable new file mode 100644 index 000000000..991f249c8 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-service-disable @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec docker-service disable "$@" diff --git a/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-service-enable b/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-service-enable new file mode 100644 index 000000000..da99c9aeb --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/usr-bin/docker-service-enable @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +exec docker-service enable "$@" + diff --git a/docker/php-official/8.6-alpine/conf/bin/usr-bin/service b/docker/php-official/8.6-alpine/conf/bin/usr-bin/service new file mode 100755 index 000000000..69874cb80 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/usr-bin/service @@ -0,0 +1,86 @@ +#!/usr/bin/env bash + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +# Root check +if [ "$(/usr/bin/whoami)" != "root" ]; then + echo "[ERROR] Must be run as root" + exit 1 +fi + +function serviceHelp() { + echo "Usage: $(basename "$0") " +} + +function getServicePid() { + local serviceName="$1" + local servicePid=$(supervisorctl pid "${serviceName}:${serviceName}d") + + if [[ -z "$servicePid" ]] || [[ "$servicePid" == "0" ]]; then + echo "not running" + exit 1 + fi + + echo $servicePid +} + +# Param check +if [ "$#" -lt 2 ]; then + echo "[ERROR] Missing parameters" + serviceHelp + exit 1 +fi + +############################# +# Param init +############################# + +SERVICENAME="$1" +ACTION="$2" + +############################# +# Service aliases +############################# +case "$SERVICENAME" in + apache2|httpd) + SERVICENAME="apache" + ;; +esac + +############################# +# Action runner +############################# +case "$ACTION" in + stop|start|restart|status) + exec supervisorctl "$ACTION" "${SERVICENAME}:${SERVICENAME}d" + ;; + + pid) + echo $(getServicePid "${SERVICENAME}") + ;; + + check) + FIRST_PID=$(getServicePid "${SERVICENAME}") + sleep 5 + SECOND_PID=$(getServicePid "${SERVICENAME}") + + if [[ "$FIRST_PID" == "$SECOND_PID" ]]; then + echo "ok" + exit 0 + else + echo "not running" + exit 1 + fi + ;; + + + *) + echo "[ERROR] Invalid action" + serviceHelp + exit 1 + ;; + +esac diff --git a/docker/php-official/8.6-alpine/conf/bin/usr-bin/version-compare b/docker/php-official/8.6-alpine/conf/bin/usr-bin/version-compare new file mode 100644 index 000000000..ca450b0e9 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/bin/usr-bin/version-compare @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +function versionCompare () { + if [[ $1 == $2 ]] + then + echo -n '=' + return + fi + local IFS=. + local i ver1=($1) ver2=($2) + # fill empty fields in ver1 with zeros + for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) + do + ver1[i]=0 + done + for ((i=0; i<${#ver1[@]}; i++)) + do + if [[ -z ${ver2[i]} ]] + then + # fill empty fields in ver2 with zeros + ver2[i]=0 + fi + if ((10#${ver1[i]} > 10#${ver2[i]})) + then + echo -n '>' + return + fi + if ((10#${ver1[i]} < 10#${ver2[i]})) + then + echo -n '<' + return + fi + done + + echo -n '=' +} + +versionCompare "$1" "$2" diff --git a/docker/php-official/8.6-alpine/conf/etc/cron/.gitkeep b/docker/php-official/8.6-alpine/conf/etc/cron/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6-alpine/conf/etc/logrotate.d/syslog-ng b/docker/php-official/8.6-alpine/conf/etc/logrotate.d/syslog-ng new file mode 100644 index 000000000..4a6f9c54e --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/etc/logrotate.d/syslog-ng @@ -0,0 +1,38 @@ +/var/log/syslog +{ + rotate 7 + daily + missingok + notifempty + delaycompress + compress + postrotate + /bin/kill -HUP `cat /var/run/syslog-ng.pid 2> /dev/null` > /dev/null + endscript +} + +/var/log/mail.info +/var/log/mail.warn +/var/log/mail.err +/var/log/mail.log +/var/log/daemon.log +/var/log/kern.log +/var/log/auth.log +/var/log/user.log +/var/log/lpr.log +/var/log/cron.log +/var/log/debug +/var/log/messages +{ + rotate 4 + weekly + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + /bin/kill -HUP `cat /var/run/syslog-ng.pid 2> /dev/null` > /dev/null + supervisorctl restart syslog-ng-stdout > /dev/null + endscript +} \ No newline at end of file diff --git a/docker/php-official/8.6-alpine/conf/etc/php/conf.d/.gitkeep b/docker/php-official/8.6-alpine/conf/etc/php/conf.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6-alpine/conf/etc/php/fpm/.gitkeep b/docker/php-official/8.6-alpine/conf/etc/php/fpm/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6-alpine/conf/etc/php/php.ini b/docker/php-official/8.6-alpine/conf/etc/php/php.ini new file mode 100644 index 000000000..447212118 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/etc/php/php.ini @@ -0,0 +1 @@ +; placeholder diff --git a/docker/php-official/8.6-alpine/conf/etc/php/php.webdevops.ini b/docker/php-official/8.6-alpine/conf/etc/php/php.webdevops.ini new file mode 100644 index 000000000..829c21e23 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/etc/php/php.webdevops.ini @@ -0,0 +1,36 @@ +; ------------------------------------- +; Docker Webdevops PHP configuration +; ------------------------------------- + +; this file will overwrite default php.ini settings + +display_errors = 0 +log_errors = 1 + +short_open_tag = Off +variables_order = 'GPCS' +request_order = 'GP' + +allow_url_fopen = On +allow_url_include = Off + +; Enable session-based upload progress only when an application needs it. +session.upload_progress.enabled = Off + +memory_limit = 512M +max_execution_time = 300 +max_input_time = 300 +post_max_size = 50M +upload_max_filesize = 50M +max_input_vars = 5000 + +expose_php = Off + +date.timezone = UTC + +mysql.default_host = mysql +mysqli.default_host = mysql + +opcache.memory_consumption = 256 +opcache.interned_strings_buffer = 16 +opcache.max_accelerated_files = 7963 diff --git a/docker/php-official/8.6-alpine/conf/etc/supervisor.conf b/docker/php-official/8.6-alpine/conf/etc/supervisor.conf new file mode 100644 index 000000000..479e0db08 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/etc/supervisor.conf @@ -0,0 +1,20 @@ +[supervisord] +nodaemon=true + +[unix_http_server] +file = /.supervisor.sock +chmod = 0700 +chown = root:root +username = root +password = {SHA}e982f17bcbe0f724063b708a4f76db211a999304 + +[supervisorctl] +serverurl = unix:///.supervisor.sock +username = root +password = docker + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[include] +files = /opt/docker/etc/supervisor.d/*.conf diff --git a/docker/php-official/8.6-alpine/conf/etc/supervisor.d/.gitkeep b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6-alpine/conf/etc/supervisor.d/cron.conf b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/cron.conf new file mode 100644 index 000000000..ef0a71678 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/cron.conf @@ -0,0 +1,14 @@ +[group:cron] +programs=crond +priority=25 + +[program:crond] +command = /opt/docker/bin/service.d/cron.sh +process_name=%(program_name)s +startsecs = 0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-official/8.6-alpine/conf/etc/supervisor.d/dnsmasq.conf b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/dnsmasq.conf new file mode 100644 index 000000000..9832ffca7 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/dnsmasq.conf @@ -0,0 +1,14 @@ +[group:dnsmasq] +programs=dnsmasqd +priority=15 + +[program:dnsmasqd] +command = /opt/docker/bin/service.d/dnsmasq.sh +process_name=%(program_name)s +startsecs = 0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-official/8.6-alpine/conf/etc/supervisor.d/php-fpm.conf b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/php-fpm.conf new file mode 100644 index 000000000..5781f5b0a --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/php-fpm.conf @@ -0,0 +1,15 @@ +[group:php-fpm] +programs=php-fpmd +priority=20 + +[program:php-fpmd] +command = /opt/docker/bin/service.d/php-fpm.sh +process_name=%(program_name)s +startsecs = 0 +autostart = true +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 + diff --git a/docker/php-official/8.6-alpine/conf/etc/supervisor.d/postfix.conf b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/postfix.conf new file mode 100644 index 000000000..b8d70bb40 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/postfix.conf @@ -0,0 +1,15 @@ +[group:postfix] +programs=postfixd +priority=30 + +[program:postfixd] +directory = /etc/postfix +command = /opt/docker/bin/service.d/postfix.sh +process_name=%(program_name)s +startsecs = 0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-official/8.6-alpine/conf/etc/supervisor.d/ssh.conf b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/ssh.conf new file mode 100644 index 000000000..0ecd798d6 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/ssh.conf @@ -0,0 +1,14 @@ +[group:ssh] +programs=sshd +priority=30 + +[program:sshd] +command = /opt/docker/bin/service.d/ssh.sh +process_name=%(program_name)s +startsecs=0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-official/8.6-alpine/conf/etc/supervisor.d/syslog.conf b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/syslog.conf new file mode 100644 index 000000000..20d1e238c --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/etc/supervisor.d/syslog.conf @@ -0,0 +1,13 @@ +[group:syslog] +programs=syslogd +priority=10 + +[program:syslogd] +command = /opt/docker/bin/service.d/syslog-ng.sh +process_name=%(program_name)s +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-official/8.6-alpine/conf/etc/syslog-ng/syslog-ng.conf b/docker/php-official/8.6-alpine/conf/etc/syslog-ng/syslog-ng.conf new file mode 100644 index 000000000..c69841581 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/etc/syslog-ng/syslog-ng.conf @@ -0,0 +1,48 @@ +@version: 3.5 + +template t_isostamp { + # syslog-t_isostamp START + template("[SYSLOG] $MSGHDR$MSG\n"); + # syslog-t_isostamp END +}; + +options { + # syslog-options START + file-template(t_isostamp); + chain_hostnames(off); + flush_lines(0); + use-dns(no); + use_fqdn(no); + owner("root"); + group("adm"); + perm(0640); + stats_freq(0); + # syslog-options START +}; + +source s_src { + # syslog-s_src START + unix-stream("/dev/log"); + internal(); + # syslog-s_src END +}; + +filter f_filter { + # syslog-f_filter START + not facility(auth, authpriv); + # syslog-f_filter END +}; + +destination d_all { + # syslog-d_all START + pipe("/docker.stdout"); + # syslog-d_all END +}; + +log { + # syslog-log START + source(s_src); + filter(f_filter); + destination(d_all); + # syslog-log START +}; diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/.gitkeep b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-entrypoint.sh b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-entrypoint.sh new file mode 100644 index 000000000..413e7b37c --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-entrypoint.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Link main entrypoint script to /entrypoint +ln -sf /opt/docker/bin/entrypoint.sh /entrypoint + +# Link entrypoint cmd shortcut conf directory to /entrypoint.cmd +ln -sf /opt/docker/bin/entrypoint.d /entrypoint.cmd + +# Create /entrypoint.d +mkdir -p /entrypoint.d +chmod 700 /entrypoint.d +chown root:root /entrypoint.d + + diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-permissions.sh b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-permissions.sh new file mode 100644 index 000000000..20d602bdd --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-permissions.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash + diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-php-init.sh b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-php-init.sh new file mode 100644 index 000000000..72d9f2454 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-php-init.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-supervisor.sh b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-supervisor.sh new file mode 100644 index 000000000..311daee4c --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-supervisor.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Remove /usr/sbin/service (images have custom service script) +rm -rf /usr/sbin/service + +# Remove existing supervisor configuration +rm -rf -- /etc/supervisor* + +# Link supervisor configuration script +ln -sf /opt/docker/etc/supervisor.conf /etc/supervisord.conf diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-user-application.sh b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-user-application.sh new file mode 100644 index 000000000..7a7b42f6b --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/10-user-application.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Add group +addgroup -g "$APPLICATION_GID" "$APPLICATION_GROUP" + +# Add user +adduser -D -u "$APPLICATION_UID" -h "/home/application" -s /bin/bash -G $APPLICATION_GROUP "$APPLICATION_USER" + diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/11-php-conf.sh b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/11-php-conf.sh new file mode 100644 index 000000000..7b8f6d3db --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/11-php-conf.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +PHP_ETC_DIR=/usr/local/etc/php +PHP_MAIN_CONF=/usr/local/etc/php-fpm.conf +PHP_POOL_CONF=www.conf +PHP_POOL_DIR=/usr/local/etc/php-fpm.d +PHP_FPM_BIN=/usr/local/sbin/php-fpm +PHP_MOD_INI_DIR=/usr/local/etc/php/conf.d diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-app.sh b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-app.sh new file mode 100644 index 000000000..749966b67 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-app.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Create /app folder +mkdir -p /app +chown "$APPLICATION_USER":"$APPLICATION_GROUP" /app diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-setup-php-fpm-pool.sh b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-setup-php-fpm-pool.sh new file mode 100644 index 000000000..c5d50e3ea --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-setup-php-fpm-pool.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# Rename pool file file to application.conf +if [[ ! -f "/opt/docker/etc/php/fpm/pool.d/application.conf" ]]; then + # Move php-fpm pool directory file to /opt/docker/etc/php/ + mv -- "$PHP_POOL_DIR" /opt/docker/etc/php/fpm/pool.d + + mv -- "/opt/docker/etc/php/fpm/pool.d/${PHP_POOL_CONF}" /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +# Remove php-fpm pool directory +rm -rf -- "$PHP_POOL_DIR" + +# Symlink php-fpm pool file to original destination +ln -sf -- /opt/docker/etc/php/fpm/pool.d "$PHP_POOL_DIR" + +# Configure php-fpm pool (application.conf) +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*catch_workers_output[\s]*=' -r 'catch_workers_output = yes' \ + -s '^[\s;]*access.format[\s]*=' -r 'access.format = "[php-fpm:access] %R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"' \ + -s '^[\s;]*access.log[\s]*=' -r 'access.log = /docker.stdout' \ + -s '^[\s;]*slowlog[\s]*=' -r 'slowlog = /docker.stderr' \ + -s '^[\s;]*php_admin_value\[error_log\][\s]*=' -r 'php_admin_value[error_log] = /docker.stderr' \ + -s '^[\s;]*php_admin_value\[log_errors\][\s]*=' -r 'php_admin_value[log_errors] = on' \ + -s '^[\s;]*listen.allowed_clients[\s]*=' -r ";listen.allowed_clients" \ + -- /opt/docker/etc/php/fpm/pool.d/application.conf + +# Fix user setting +go-replace --mode=line --regex \ + -s '^[\s;]*user[\s]*=' -r "user = $APPLICATION_USER" \ + -s '^[\s;]*group[\s]*=' -r "group = $APPLICATION_GROUP" \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' + +# Keep the environment variables of the container for PHP +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*clear_env[\s]*=' -r 'clear_env = no' \ + -- /opt/docker/etc/php/fpm/pool.d/application.conf diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-setup-php-fpm.sh b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-setup-php-fpm.sh new file mode 100644 index 000000000..9f96894b1 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-setup-php-fpm.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +# Link main php-fpm binary +ln -sf -- "$PHP_FPM_BIN" /usr/local/bin/php-fpm + +# Move php-fpm main file to /opt/docker/etc/php/fpm/ and create symlink +if [[ ! -f /opt/docker/etc/php/fpm/php-fpm.conf ]]; then + mv -- "$PHP_MAIN_CONF" /opt/docker/etc/php/fpm/php-fpm.conf +else + rm -f -- "$PHP_MAIN_CONF" +fi +ln -sf -- /opt/docker/etc/php/fpm/php-fpm.conf "$PHP_MAIN_CONF" + +# Configure php-fpm main (all versions) +go-replace --mode=lineinfile --regex \ + --lineinfile-after='\[global\]' \ + -s '^[\s;]*error_log[\s]*=' -r 'error_log = /docker.stderr' \ + -s '^[\s;]*pid[\s]*=' -r 'pid = /var/run/php-fpm.pid' \ + -- /opt/docker/etc/php/fpm/php-fpm.conf + +# Listen on port 9000 of all addresses: PHP-FPM binds to [::] (IPv6 and IPv4) +# and falls back to 0.0.0.0 if the container has no IPv6 +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-setup-php.sh b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-setup-php.sh new file mode 100644 index 000000000..71caa48d3 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/20-setup-php.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +case "$IMAGE_FAMILY" in + Debian|Ubuntu|Alpine) + # Register webdevops ini + ln -sf "/opt/docker/etc/php/php.webdevops.ini" "${PHP_ETC_DIR}/conf.d/98-webdevops.ini" + + # Register custom php ini + ln -sf "/opt/docker/etc/php/php.ini" "${PHP_ETC_DIR}/conf.d/99-docker.ini" + ;; +esac diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh new file mode 100644 index 000000000..8d15159dc --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/30-setup-ioncube.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +if [ $IMAGE_FAMILY == "Alpine" ]; then + echo "Skipping ionCube installation on Alpine" + return +fi + +# The official PHP images are thread safe (ZTS) since PHP 8.6 and are built without +# Zend signals, which the ionCube ZTS loader needs (undefined zend_signal_globals_offset) +if [[ "$(php -n -r 'echo PHP_ZTS;')" == "1" ]]; then + echo "Skipping ionCube installation: the ionCube loader does not support this thread-safe PHP build" + return +fi + +echo "Installing ionCube loader" + +case "$(uname -m)" in + x86_64) IONCUBE_ARCH="x86-64" ;; + aarch64) IONCUBE_ARCH="aarch64" ;; + *) + echo "Skipping ionCube installation on unsupported architecture $(uname -m)" + return + ;; +esac + +DOWNLOAD_URL="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${IONCUBE_ARCH}.tar.gz" +TMP_FILE="/tmp/ioncube_loaders.tar.gz" + +echo "Downloading ..." +curl -fsS "${DOWNLOAD_URL}" -o "${TMP_FILE}" +echo "Unpacking ..." +tar -xzf ${TMP_FILE} -C /tmp + +PHP_VERSION="$(php -n -r 'echo PHP_MAJOR_VERSION, ".", PHP_MINOR_VERSION;')" +PHP_EXTENSION_DIR="$(php -n -r 'echo ini_get("extension_dir");')" +MOD_INI="${PHP_MOD_INI_DIR}/00-ioncube.ini" +SO_FILE="${PHP_EXTENSION_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" + +echo "PHP-VERSION: ${PHP_VERSION}" +echo "PHP-EXTENSION-DIR: ${PHP_EXTENSION_DIR}" +if [[ ! -f "/tmp/ioncube/ioncube_loader_lin_${PHP_VERSION}.so" ]]; then + echo "There is no ioncube available for PHP${PHP_VERSION}, skipping installation" +else + echo "Installing ${SO_FILE}" + cp "/tmp/ioncube/ioncube_loader_lin_${PHP_VERSION}.so" ${SO_FILE} + + echo "Checking ionCube loader" + php -n -d "zend_extension=${SO_FILE}" -r 'exit(extension_loaded("ionCube Loader") ? 0 : 1);' || return 1 + + echo "Writing module ini" + echo "[ioncube]" > ${MOD_INI} + echo "zend_extension = ${SO_FILE}" >> ${MOD_INI} + echo "; priority=01" >> ${MOD_INI} + + echo "Enabling ionCube PHP module" + case "$IMAGE_FAMILY" in + Debian|Ubuntu) + # Enable ionCube (if available) + if [[ -f "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" ]]; then + ln -sf "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" "${PHP_ETC_DIR}/cli/conf.d/00-ioncube.ini" + ln -sf "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" "${PHP_ETC_DIR}/fpm/conf.d/00-ioncube.ini" + fi + ;; + esac +fi + +echo "Cleaning up" +rm -rf "$TMP_FILE" /tmp/ioncube diff --git a/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/90-cleanup.sh b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/90-cleanup.sh new file mode 100644 index 000000000..3ca393da6 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/bootstrap.d/90-cleanup.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Remove default cronjobs +rm -f -- \ + /etc/cron.daily/logrotate \ + /etc/cron.daily/apt-compat \ + /etc/cron.daily/dpkg \ + /etc/cron.daily/passwd \ + /etc/cron.daily/0yum-daily.cron \ + /etc/cron.daily/logrotate \ + /etc/cron.hourly/0yum-hourly.cron \ + /etc/periodic/daily/logrotate diff --git a/docker/php-official/8.6-alpine/conf/provision/build.d/.gitkeep b/docker/php-official/8.6-alpine/conf/provision/build.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6-alpine/conf/provision/build.d/10-cleanup.sh b/docker/php-official/8.6-alpine/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..41031b784 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* +rm -rf -- /root/.profile diff --git a/docker/php-official/8.6-alpine/conf/provision/entrypoint.d/.gitkeep b/docker/php-official/8.6-alpine/conf/provision/entrypoint.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6-alpine/conf/provision/entrypoint.d/05-permissions.sh b/docker/php-official/8.6-alpine/conf/provision/entrypoint.d/05-permissions.sh new file mode 100644 index 000000000..6f77d8e40 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/entrypoint.d/05-permissions.sh @@ -0,0 +1,2 @@ +# Fix rights of /tmp (can be a volume) +chmod 1777 /tmp diff --git a/docker/php-official/8.6-alpine/conf/provision/entrypoint.d/20-php-fpm.sh b/docker/php-official/8.6-alpine/conf/provision/entrypoint.d/20-php-fpm.sh new file mode 100644 index 000000000..5ab722cf7 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/entrypoint.d/20-php-fpm.sh @@ -0,0 +1,80 @@ +####################################### +### FPM MAIN +####################################### + +container-file-auto-restore "/opt/docker/etc/php/fpm/php-fpm.conf" + +echo '' >> /opt/docker/etc/php/fpm/php-fpm.conf +echo '; container env settings' >> /opt/docker/etc/php/fpm/php-fpm.conf +echo '[global]' >> /opt/docker/etc/php/fpm/php-fpm.conf + +if [[ -n "${FPM_PROCESS_MAX+x}" ]]; then + echo "process.max = ${FPM_PROCESS_MAX}" >> /opt/docker/etc/php/fpm/php-fpm.conf +fi + +# General fpm main setting +for ENV_VAR in $(envListVars "fpm\.global\."); do + env_key=${ENV_VAR#fpm.global.} + env_val=$(envGetValue "$ENV_VAR") + + echo "$env_key = ${env_val}" >> /opt/docker/etc/php/fpm/php-fpm.conf +done + +####################################### +### FPM POOL +####################################### + +container-file-auto-restore "/opt/docker/etc/php/fpm/pool.d/application.conf" + +echo '' >> /opt/docker/etc/php/fpm/pool.d/application.conf +echo '; container env settings' >> /opt/docker/etc/php/fpm/pool.d/application.conf + +# General fpm pool setting +for ENV_VAR in $(envListVars "fpm\.pool\."); do + env_key=${ENV_VAR#fpm.pool.} + env_val=$(envGetValue "$ENV_VAR") + + echo "$env_key = ${env_val}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +done + + +if [[ -n "${FPM_PM_MAX_CHILDREN+x}" ]]; then + echo "pm.max_children = ${FPM_PM_MAX_CHILDREN}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_PM_START_SERVERS+x}" ]]; then + echo "pm.start_servers = ${FPM_PM_START_SERVERS}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_PM_MIN_SPARE_SERVERS+x}" ]]; then + echo "pm.min_spare_servers = ${FPM_PM_MIN_SPARE_SERVERS}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_PM_MAX_SPARE_SERVERS+x}" ]]; then + echo "pm.max_spare_servers = ${FPM_PM_MAX_SPARE_SERVERS}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_PROCESS_IDLE_TIMEOUT+x}" ]]; then + echo "pm.process_idle_timeout = ${FPM_PROCESS_IDLE_TIMEOUT}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_MAX_REQUESTS+x}" ]]; then + echo "pm.max_requests = ${FPM_MAX_REQUESTS}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_REQUEST_TERMINATE_TIMEOUT+x}" ]]; then + echo "request_terminate_timeout = ${FPM_REQUEST_TERMINATE_TIMEOUT}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_RLIMIT_FILES+x}" ]]; then + echo "rlimit_files = ${FPM_RLIMIT_FILES}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_RLIMIT_CORE+x}" ]]; then + echo "rlimit_core = ${FPM_RLIMIT_CORE}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +# Workaround for official PHP images +if [[ -n "${PHP_SENDMAIL_PATH+x}" ]]; then + echo "php_admin_value[sendmail_path] = ${PHP_SENDMAIL_PATH}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi diff --git a/docker/php-official/8.6-alpine/conf/provision/entrypoint.d/20-php.sh b/docker/php-official/8.6-alpine/conf/provision/entrypoint.d/20-php.sh new file mode 100644 index 000000000..2e208fb85 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/entrypoint.d/20-php.sh @@ -0,0 +1,75 @@ +container-file-auto-restore "/opt/docker/etc/php/php.webdevops.ini" + +echo '' >> /opt/docker/etc/php/php.webdevops.ini +echo '; container env settings' >> /opt/docker/etc/php/php.webdevops.ini + +# General php setting +for ENV_VAR in $(envListVars "php\."); do + env_key=${ENV_VAR#php.} + env_val=$(envGetValue "$ENV_VAR") + + echo "$env_key = ${env_val}" >> /opt/docker/etc/php/php.webdevops.ini +done + + +if [[ -n "${PHP_DATE_TIMEZONE+x}" ]]; then + echo "date.timezone = ${PHP_DATE_TIMEZONE}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_DISPLAY_ERRORS+x}" ]]; then + echo "display_errors = ${PHP_DISPLAY_ERRORS}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_MEMORY_LIMIT+x}" ]]; then + echo "memory_limit = ${PHP_MEMORY_LIMIT}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_MAX_EXECUTION_TIME+x}" ]]; then + echo "max_execution_time = ${PHP_MAX_EXECUTION_TIME}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_POST_MAX_SIZE+x}" ]]; then + echo "post_max_size = ${PHP_POST_MAX_SIZE}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_UPLOAD_MAX_FILESIZE+x}" ]]; then + echo "upload_max_filesize = ${PHP_UPLOAD_MAX_FILESIZE}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_OPCACHE_MEMORY_CONSUMPTION+x}" ]]; then + echo "opcache.memory_consumption = ${PHP_OPCACHE_MEMORY_CONSUMPTION}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_OPCACHE_MAX_ACCELERATED_FILES+x}" ]]; then + echo "opcache.max_accelerated_files = ${PHP_OPCACHE_MAX_ACCELERATED_FILES}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_OPCACHE_VALIDATE_TIMESTAMPS+x}" ]]; then + echo "opcache.validate_timestamps = ${PHP_OPCACHE_VALIDATE_TIMESTAMPS}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_OPCACHE_REVALIDATE_FREQ+x}" ]]; then + echo "opcache.revalidate_freq = ${PHP_OPCACHE_REVALIDATE_FREQ}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_OPCACHE_INTERNED_STRINGS_BUFFER+x}" ]]; then + echo "opcache.interned_strings_buffer = ${PHP_OPCACHE_INTERNED_STRINGS_BUFFER}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +# Workaround for official PHP images +if [[ -n "${PHP_SENDMAIL_PATH+x}" ]]; then + echo "sendmail_path = ${PHP_SENDMAIL_PATH}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +# Disable all PHP mods specified in PHP_DISMOD as comma separated list +if [[ -n "${PHP_DISMOD+x}" ]]; then + ini_dir_cli=$(php -i | grep 'Scan this dir for additional .ini files' | cut -c44-) + ini_dir_fpm=$(php-fpm -i | grep 'Scan this dir for additional .ini files' | cut -c44-) + for DISABLE_MOD in ${PHP_DISMOD//,/ }; do + rm -f ${ini_dir_cli}/*${DISABLE_MOD}* + rm -f ${ini_dir_fpm}/*${DISABLE_MOD}* + done +fi + +# Link composer version accordingly +ln -sf /usr/local/bin/composer${COMPOSER_VERSION:-2} /usr/local/bin/composer diff --git a/docker/php-official/8.6-alpine/conf/provision/service.d/.gitkeep b/docker/php-official/8.6-alpine/conf/provision/service.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6-alpine/conf/provision/service.d/cron.sh b/docker/php-official/8.6-alpine/conf/provision/service.d/cron.sh new file mode 100644 index 000000000..bd8a54781 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/service.d/cron.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + apt-install cron + ;; + + RedHat) + yum-install cronie + ;; +esac diff --git a/docker/php-official/8.6-alpine/conf/provision/service.d/dnsmasq.sh b/docker/php-official/8.6-alpine/conf/provision/service.d/dnsmasq.sh new file mode 100644 index 000000000..9e5c3228c --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/service.d/dnsmasq.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +# Installation +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + apt-install dnsmasq + ;; + + RedHat) + yum-install dnsmasq + ;; + + Alpine) + apk-install dnsmasq + ;; +esac + +# Configuration +go-replace --mode=line \ + -s '^[\s]*user[\s]*=' -r 'user = root' \ + -s '^[\s]*conf-dir[\s]*=' -r 'conf-dir = /etc/dnsmasq.d' \ + -- /etc/dnsmasq.conf diff --git a/docker/php-official/8.6-alpine/conf/provision/service.d/postfix.sh b/docker/php-official/8.6-alpine/conf/provision/service.d/postfix.sh new file mode 100644 index 000000000..a8c7cc61b --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/service.d/postfix.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +# Installation +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + apt-install postfix + ;; + + RedHat) + yum-install postfix + + # Fix mysql lib + if [[ ! -f /lib64/libmysqlclient.so.18 ]] && [[ -f /usr/lib64/mysql/libmysqlclient.so.18 ]]; then + ln -s /usr/lib64/mysql/libmysqlclient.so.18 /lib64/libmysqlclient.so.18 + fi + ;; + + Alpine) + apk-install postfix + ;; +esac + +# Configuration +go-replace --mode=line \ + -s '^[\s]*mydestination[\s]*=' -r 'mydestination = ' \ + -s '^[\s]*message_size_limit[\s]*=' -r 'message_size_limit = 15240000' \ + -s '^[\s]*smtp_use_tls[\s]*=' -r 'smtp_use_tls = yes' \ + -s '^[\s]*smtp_tls_security_level[\s]*=' -r 'smtp_tls_security_level = may' \ + -s '^[\s]*myhostname[\s]*=' -r '# myhostname' \ + -- /etc/postfix/main.cf diff --git a/docker/php-official/8.6-alpine/conf/provision/service.d/ssh.sh b/docker/php-official/8.6-alpine/conf/provision/service.d/ssh.sh new file mode 100644 index 000000000..63d7a9f3a --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/service.d/ssh.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + apt-install openssh-server + ;; + + RedHat) + yum-install openssh-server + ;; + + Alpine) + apk-install openssh + ;; +esac diff --git a/docker/php-official/8.6-alpine/conf/provision/service.d/syslog.sh b/docker/php-official/8.6-alpine/conf/provision/service.d/syslog.sh new file mode 100644 index 000000000..675d0b061 --- /dev/null +++ b/docker/php-official/8.6-alpine/conf/provision/service.d/syslog.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +# Installation +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + apt-install syslog-ng syslog-ng-core + ;; + + RedHat) + yum-install syslog-ng + + # remove logrotate (not needed for docker) + rm -f "/etc/cron.daily/logrotate" + ;; + + Alpine) + apk-install syslog-ng + ;; +esac + +## Configuration +SYSLOG_NG_VERSION=$(syslog-ng --version | grep -E -e '^Installer-Version:[ ]+[0-9]+\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d .) + +# Disable caps inside container +if [[ -f /etc/default/syslog-ng ]]; then + go-replace --mode=lineinfile \ + -s "SYSLOGNG_OPTS" -r "SYSLOGNG_OPTS = --no-caps" \ + -- /etc/default/syslog-ng +fi + +# Symlink configuration +ln -s -f /opt/docker/etc/syslog-ng/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf + +go-replace --mode=lineinfile \ + -s "@version" -r "@version: ${SYSLOG_NG_VERSION}" \ + -- /etc/syslog-ng/syslog-ng.conf + +# Ensure /var/lib/syslog-ng exists +mkdir -p /var/lib/syslog-ng diff --git a/docker/php-official/8.6/Dockerfile b/docker/php-official/8.6/Dockerfile new file mode 100644 index 000000000..844935b42 --- /dev/null +++ b/docker/php-official/8.6/Dockerfile @@ -0,0 +1,260 @@ +#+++++++++++++++++++++++++++++++++++++++ +# Dockerfile for webdevops/php-official:8.6 +# -- automatically generated -- +#+++++++++++++++++++++++++++++++++++++++ + + +FROM php:8.6-rc-fpm-trixie + +LABEL maintainer=info@webdevops.io \ + vendor=WebDevOps.io \ + io.webdevops.layout=8 \ + io.webdevops.version=1.5.0 + +ENV TERM="xterm" \ + LANG="C.UTF-8" \ + LC_ALL="C.UTF-8" +ENV DOCKER_CONF_HOME=/opt/docker/ \ + LOG_STDOUT="" \ + LOG_STDERR="" +ENV APPLICATION_USER=application \ + APPLICATION_GROUP=application \ + APPLICATION_PATH=/app \ + APPLICATION_UID=1000 \ + APPLICATION_GID=1000 +ENV PHP_SENDMAIL_PATH="/usr/sbin/sendmail -t -i" +ENV COMPOSER_VERSION="2" + + +# Baselayout copy (from staged image) +COPY --from=webdevops/toolbox /baselayout/sbin/* /sbin/ +COPY --from=webdevops/toolbox /baselayout/usr/local/bin/* /usr/local/bin/ + + +COPY conf/ /opt/docker/ + +RUN set -x \ + # Init bootstrap + && apt-update \ + && /usr/local/bin/generate-dockerimage-info \ + # Enable non-free + && sed -ri "s/(deb.*\/debian $(docker-image-info dist-codename) main)/\1 contrib non-free /" -- /etc/apt/sources.list.d/debian.sources \ + && apt-update \ + # System update + && /usr/local/bin/apt-upgrade \ + # Base stuff + && apt-install \ + apt-transport-https \ + ca-certificates \ + locales \ + gnupg + +RUN set -x \ + # Install packages + && chmod +x /opt/docker/bin/* \ + && apt-install \ + supervisor \ + wget \ + curl \ + vim \ + net-tools \ + tzdata \ + && chmod +s /sbin/gosu \ + && docker-run-bootstrap \ + && docker-image-cleanup + +RUN set -x \ + # Install services + && apt-install \ + # Install common tools + zip \ + unzip \ + bzip2 \ + moreutils \ + bind9-dnsutils \ + openssh-client \ + rsync \ + git \ + patch \ + && /usr/local/bin/generate-locales \ + && docker-run-bootstrap \ + && docker-image-cleanup + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + # Install php environment + && apt-install \ + # Install tools + file \ + imagemagick \ + graphicsmagick \ + ghostscript \ + jpegoptim \ + libjpeg-turbo-progs \ + pngcrush \ + optipng \ + apngopt \ + pngnq \ + pngquant \ + # Libraries + libavif16 \ + libvips42t64 \ + libldap2 \ + libpng16-16t64 \ + libzip5 \ + libmemcached11t64 \ + librabbitmq4 \ + libxslt1.1 \ + libldap-common \ + zlib1g \ + libpq5 \ + libmcrypt4 \ + libyaml-0-2 \ + libonig5 \ + # Dev and headers + libavif-dev \ + libjpeg62-turbo-dev \ + libwebp-dev \ + libfreetype-dev \ + libbz2-dev \ + libicu-dev \ + libldap2-dev \ + libldb-dev \ + libmcrypt-dev \ + libxml2-dev \ + libxslt1-dev \ + zlib1g-dev \ + libmemcached-dev \ + libpng-dev \ + libpq-dev \ + libzip-dev \ + libkrb5-dev \ + libvips-dev \ + librabbitmq-dev \ + libmagick++-dev \ + libgmp-dev \ + libyaml-dev \ + libssl-dev \ + libonig-dev \ + # Install guetzli + && wget https://github.com/google/guetzli/archive/master.zip \ + && unzip master.zip \ + && make -C guetzli-master \ + && cp guetzli-master/bin/Release/guetzli /usr/local/bin/ \ + && rm -rf master.zip guetzli-master \ + # Install new version of ICU + && curl -sS -o /tmp/icu.tar.gz -L https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz \ + && tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make -j"$(nproc)" && make install && cd / && rm -rf /tmp/icu* \ + # Install extensions + && PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \ + && docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \ + && git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \ + # TODO PHP 8.6: php-amqp has no release supporting PHP 8.6 yet; build the + # unmerged upstream fix https://github.com/php-amqp/php-amqp/pull/638 (pinned commit) + && cd /usr/src/php/ext/amqp \ + && git fetch --depth 1 origin 58edfb5e51a49cd10174cdfb18c73a539892d53d \ + && git checkout -q FETCH_HEAD \ + && git submodule update --init \ + && git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \ + && docker-php-ext-configure ldap \ + && docker-php-ext-configure ftp --with-ftp-ssl \ + && docker-php-ext-install -j"$(nproc)" \ + bcmath \ + amqp \ + imagick \ + ffi \ + bz2 \ + calendar \ + exif \ + ftp \ + gmp \ + intl \ + gettext \ + ldap \ + mysqli \ + mbstring \ + pcntl \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + soap \ + sockets \ + sysvmsg \ + sysvsem \ + sysvshm \ + shmop \ + xsl \ + zip \ + gd \ + && cd / \ + && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ + --skip-enable-extension --make-parallel-jobs="$(nproc)" \ + # TODO PHP 8.6: the PHP 8.6 fixes of these extensions are merged upstream but not + # released yet; build their development branches until a release supports PHP 8.6 + "apcu/apcu:dev-master" \ + "wikimedia/excimer:dev-master" \ + open-telemetry/ext-opentelemetry \ + "php-memcached/php-memcached:dev-master" \ + "pecl/yaml:dev-php7" \ + "phpredis/phpredis:dev-develop" \ + mongodb/mongodb-extension \ + && rm -rf /tmp/pie \ + && PROTOBUF_RELEASE_URL="$(curl -fsSLI --proto '=https' --proto-redir '=https' --retry 3 -o /dev/null -w '%{url_effective}' https://github.com/protocolbuffers/protobuf/releases/latest)" \ + && PROTOBUF_VERSION="${PROTOBUF_RELEASE_URL##*/}" \ + && mkdir -p /tmp/protobuf \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 "https://codeload.github.com/protocolbuffers/protobuf/tar.gz/refs/tags/${PROTOBUF_VERSION}" -o /tmp/protobuf.tar.gz \ + && tar -xzf /tmp/protobuf.tar.gz --strip-components=1 -C /tmp/protobuf \ + && cd /tmp/protobuf/php/ext/google/protobuf \ + && mkdir -p third_party \ + && cp -R /tmp/protobuf/third_party/utf8_range third_party/ \ + # TODO PHP 8.6: protobuf still calls the zval_dtor() alias removed in PHP 8.6 + # https://github.com/protocolbuffers/protobuf/issues/29723 + && grep -rl 'zval_dtor(' . | xargs -r sed -i 's/\([^_a-z]\)zval_dtor(/\1zval_ptr_dtor_nogc(/g' \ + && phpize && ./configure --enable-protobuf \ + && make -j"$(nproc)" && make install \ + && cd / && rm -rf /tmp/protobuf /tmp/protobuf.tar.gz \ + && echo extension=apcu.so > /usr/local/etc/php/conf.d/apcu.ini \ + && echo extension=excimer.so > /usr/local/etc/php/conf.d/excimer.ini \ + && echo extension=opentelemetry.so > /usr/local/etc/php/conf.d/opentelemetry.ini \ + && echo extension=protobuf.so > /usr/local/etc/php/conf.d/protobuf.ini \ + && echo extension=redis.so > /usr/local/etc/php/conf.d/redis.ini \ + && echo extension=mongodb.so > /usr/local/etc/php/conf.d/mongodb.ini \ + && echo extension=memcached.so > /usr/local/etc/php/conf.d/memcached.ini \ + && echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \ + # Uninstall dev and header packages + && apt-get purge -y -f --force-yes \ + libkrb5-dev \ + libbz2-dev \ + libavif-dev \ + libicu-dev \ + libldap2-dev \ + libldb-dev \ + libmcrypt-dev \ + libxml2-dev \ + libxslt1-dev \ + zlib1g-dev \ + libpng-dev \ + libwebp-dev \ + libpq-dev \ + libzip-dev \ + libvips-dev \ + librabbitmq-dev \ + libmagick++-dev \ + libgmp-dev \ + libyaml-dev \ + libssl-dev \ + libonig-dev \ + && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ + && ln -sf /usr/local/bin/composer2 /usr/local/bin/composer \ + # Enable php services + && docker-service enable syslog \ + && docker-service enable cron \ + && docker-run-bootstrap \ + && docker-image-cleanup + +WORKDIR / +EXPOSE 9000 +ENTRYPOINT ["/entrypoint"] +CMD ["supervisord"] diff --git a/docker/php-official/8.6/Dockerfile.twig b/docker/php-official/8.6/Dockerfile.twig new file mode 100644 index 000000000..207b2a51b --- /dev/null +++ b/docker/php-official/8.6/Dockerfile.twig @@ -0,0 +1,46 @@ +{% import 'docker.twig' as docker %} +{% import 'provision.twig' as provision %} +{% import 'environment.twig' as environment %} +{% import 'baselayout.twig' as baselayout %} +{% import 'images/bootstrap.twig' as bootstrap %} +{% import 'images/base.twig' as base %} +{% import 'images/baseapp.twig' as baseapp %} +{% import 'images/php.twig' as php %} + +{{ docker.fromOfficial("php", "8.6-rc-fpm-trixie") }} + +{{ docker.version() }} + +{{ environment.general() }} +{{ environment.base() }} +{{ environment.baseApp() }} +{{ environment.phpOfficialSendmailWorkaround() }} +{{ environment.phpComposerVersion() }} + +{{ baselayout.copy() }} + +{{ docker.copy('conf/', '/opt/docker/') }} + +RUN set -x \ + {{ bootstrap.debian() }} + +RUN set -x \ + {{ base.debian() }} \ + {{ provision.runBootstrap() }} \ + {{ docker.cleanup() }} + +RUN set -x \ + {{ baseapp.debian() }} \ + {{ provision.runBootstrap() }} \ + {{ docker.cleanup() }} + +RUN --mount=type=bind,from=ghcr.io/php/pie:bin,source=/pie,target=/usr/local/bin/pie \ + set -x \ + {{ php.official(version='8.6', distribution='trixie') }} \ + {{ provision.runBootstrap() }} \ + {{ docker.cleanup() }} + +{{ docker.workdir('/') }} +{{ docker.expose('9000') }} +{{ docker.entrypoint("/entrypoint") }} +{{ docker.cmd("supervisord") }} diff --git a/docker/php-official/8.6/conf/VERSION b/docker/php-official/8.6/conf/VERSION new file mode 100644 index 000000000..301160a93 --- /dev/null +++ b/docker/php-official/8.6/conf/VERSION @@ -0,0 +1 @@ +8 \ No newline at end of file diff --git a/docker/php-official/8.6/conf/bin/bootstrap.sh b/docker/php-official/8.6/conf/bin/bootstrap.sh new file mode 100644 index 000000000..b1b3acdbc --- /dev/null +++ b/docker/php-official/8.6/conf/bin/bootstrap.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec docker-run-bootstrap diff --git a/docker/php-official/8.6/conf/bin/config.sh b/docker/php-official/8.6/conf/bin/config.sh new file mode 100644 index 000000000..46265a3c0 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/config.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash + +shopt -s nullglob + +### + # Check if current user is root + # + ## +function rootCheck() { + # Root check + if [ "$(/usr/bin/whoami)" != "root" ]; then + echo "[ERROR] $* must be run as root" + exit 1 + fi +} + +### + # Create /docker.stdout and /docker.stderr + # + ## +function createDockerStdoutStderr() { + # link stdout from docker + if [[ -n "$LOG_STDOUT" ]]; then + echo "Log stdout redirected to $LOG_STDOUT" + else + LOG_STDOUT="/proc/$$/fd/1" + fi + + if [[ -n "$LOG_STDERR" ]]; then + echo "Log stderr redirected to $LOG_STDERR" + else + LOG_STDERR="/proc/$$/fd/2" + fi + + ln -f -s "$LOG_STDOUT" /docker.stdout + ln -f -s "$LOG_STDERR" /docker.stderr +} +### + # Include script directory text inside a file + # + # $1 -> path + # + ## +function includeScriptDir() { + if [[ -d "$1" ]]; then + for FILE in "$1"/*.sh; do + echo "-> Executing ${FILE}" + # run custom scripts, only once + . "$FILE" + done + fi +} + +### + # Show deprecation notice + # + ## +function deprecationNotice() { + echo "" + echo "###############################################################################" + echo "### THIS CALL IS DEPRECATED AND WILL BE REMOVED IN THE FUTURE" + echo "###" + echo "### $*" + echo "###" + echo "###############################################################################" + echo "" +} + +### + # Run "entrypoint" scripts + ## +function runEntrypoints() { + ############### + # Try to find entrypoint + ############### + + ENTRYPOINT_SCRIPT="/opt/docker/bin/entrypoint.d/${TASK}.sh" + + if [ -f "$ENTRYPOINT_SCRIPT" ]; then + . "$ENTRYPOINT_SCRIPT" + fi + + ############### + # Run default + ############### + if [ -f "/opt/docker/bin/entrypoint.d/default.sh" ]; then + . /opt/docker/bin/entrypoint.d/default.sh + fi + + exit 1 +} + + # Run "entrypoint" provisioning + ## +function runProvisionEntrypoint() { + includeScriptDir "/opt/docker/provision/entrypoint.d" + includeScriptDir "/entrypoint.d" +} + +### + # List environment variables (based on prefix) + ## +function envListVars() { + if [[ $# -eq 1 ]]; then + env | grep "^${1}" | cut -d= -f1 + else + env | cut -d= -f1 + fi +} + +### + # Get environment variable (even with dots in name) + # + ## +function envGetValue() { + awk "BEGIN {print ENVIRON[\"$1\"]}" +} diff --git a/docker/php-official/8.6/conf/bin/control.sh b/docker/php-official/8.6/conf/bin/control.sh new file mode 100644 index 000000000..72111f395 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/control.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +source /opt/docker/bin/config.sh + +rootCheck "$0" + +CONTROL_COMMAND="$1" +shift + +case "$CONTROL_COMMAND" in + + ## ------------------------------------------ + ## Service + ## ------------------------------------------ + + "service.enable") + deprecationNotice " Please use >>docker-service-enable [service]<<" + docker-service-enable "$1" + ;; + + "service.disable") + deprecationNotice " Please use >>docker-service-disable [service]<<" + docker-service-disable "$1" + ;; + + ## ------------------------------------------ + ## Version + ## ------------------------------------------ + + "version.get") + cat /opt/docker/VERSION + ;; + + "version.require.min") + EXPECTED_VERSION="$1" + CURRENT_VERSION="$(cat /opt/docker/VERSION)" + if [ "$CURRENT_VERSION" -lt "$EXPECTED_VERSION" ]; then + echo "-----------------------------------------------------------" + echo "--- This docker image is not up2date!" + echo "--- " + echo "--- Version expected min: $EXPECTED_VERSION" + echo "--- Version current: $CURRENT_VERSION" + echo "--- " + echo "--- Run 'docker pull ' to update image" + echo "-----------------------------------------------------------" + exit 1 + fi + ;; + + "version.require.max") + EXPECTED_VERSION="$1" + CURRENT_VERSION="$(cat /opt/docker/VERSION)" + if [ "$CURRENT_VERSION" -gt "$EXPECTED_VERSION" ]; then + echo "-----------------------------------------------------------" + echo "--- This docker image is too new!" + echo "--- " + echo "--- Version expected max: $EXPECTED_VERSION" + echo "--- Version current: $CURRENT_VERSION" + echo "-----------------------------------------------------------" + exit 1 + fi + ;; + + + "buildtime.get") + cat /opt/docker/BUILDTIME + ;; + + *) + echo "[ERROR] Invalid controll command: \"${CONTROL_COMMAND}\"" + exit 1 + ;; +esac diff --git a/docker/php-official/8.6/conf/bin/entrypoint.d/cli.sh b/docker/php-official/8.6/conf/bin/entrypoint.d/cli.sh new file mode 100644 index 000000000..fe212a8ea --- /dev/null +++ b/docker/php-official/8.6/conf/bin/entrypoint.d/cli.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +############################################# +## Run CLI_SCRIPT from environment variable +############################################# + +if [ -n "${CLI_SCRIPT}" ]; then + if [ -n "$APPLICATION_USER" ]; then + # Run as EFFECTIVE_USER + shift + exec gosu "${APPLICATION_USER}" ${CLI_SCRIPT} "$@" + else + # Run as root + exec ${CLI_SCRIPT} "$@" + fi +else + echo "[ERROR] No CLI_SCRIPT in in docker environment defined" + exit 1 +fi diff --git a/docker/php-official/8.6/conf/bin/entrypoint.d/default.sh b/docker/php-official/8.6/conf/bin/entrypoint.d/default.sh new file mode 100644 index 000000000..a1be715fe --- /dev/null +++ b/docker/php-official/8.6/conf/bin/entrypoint.d/default.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec "$@" diff --git a/docker/php-official/8.6/conf/bin/entrypoint.d/noop.sh b/docker/php-official/8.6/conf/bin/entrypoint.d/noop.sh new file mode 100644 index 000000000..092d55d8b --- /dev/null +++ b/docker/php-official/8.6/conf/bin/entrypoint.d/noop.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +############################################# +## NOOP (no operation) +############################################# + +exec tail -f /dev/null diff --git a/docker/php-official/8.6/conf/bin/entrypoint.d/root.sh b/docker/php-official/8.6/conf/bin/entrypoint.d/root.sh new file mode 100644 index 000000000..6fa0d063e --- /dev/null +++ b/docker/php-official/8.6/conf/bin/entrypoint.d/root.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +############################################# +## Root shell +############################################# + +if [ "$#" -eq 1 ]; then + ## No command, fall back to interactive shell + exec bash +else + ## Exec root command + shift + exec "$@" +fi diff --git a/docker/php-official/8.6/conf/bin/entrypoint.d/supervisord.sh b/docker/php-official/8.6/conf/bin/entrypoint.d/supervisord.sh new file mode 100644 index 000000000..f21489667 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/entrypoint.d/supervisord.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +############################################# +## Supervisord (start daemons) +############################################# + +## Start services +exec /opt/docker/bin/service.d/supervisor.sh + diff --git a/docker/php-official/8.6/conf/bin/entrypoint.sh b/docker/php-official/8.6/conf/bin/entrypoint.sh new file mode 100644 index 000000000..0489b796c --- /dev/null +++ b/docker/php-official/8.6/conf/bin/entrypoint.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +if [[ -z "$CONTAINER_UID" ]]; then + export CONTAINER_UID="application" +fi + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +# auto elevate privileges (if container is not started as root) +if [[ "$UID" -ne 0 ]]; then + export CONTAINER_UID="$UID" + exec gosu root "$0" "$@" +fi +# remove suid bit on gosu +chmod -s /sbin/gosu + +trap 'echo sigterm ; exit' SIGTERM +trap 'echo sigkill ; exit' SIGKILL + +# sanitize input and set task +TASK="$(echo $1| sed 's/[^-_a-zA-Z0-9]*//g')" + +source /opt/docker/bin/config.sh + +createDockerStdoutStderr + +if [[ "$UID" -eq 0 ]]; then + # Only run provision if user is root + + if [ "$TASK" == "supervisord" -o "$TASK" == "noop" ]; then + # Visible provisioning + runProvisionEntrypoint + else + # Hidden provisioning + runProvisionEntrypoint > /dev/null + fi +fi + +############################# +## COMMAND +############################# + +runEntrypoints "$@" diff --git a/docker/php-official/8.6/conf/bin/service.d/cron.d/10-init.sh b/docker/php-official/8.6/conf/bin/service.d/cron.d/10-init.sh new file mode 100644 index 000000000..611edc9bf --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/cron.d/10-init.sh @@ -0,0 +1,16 @@ +# Install crontab files + +if [[ -d "/opt/docker/etc/cron" ]]; then + mkdir -p /etc/cron.d/ + + find /opt/docker/etc/cron -type f | while read CRONTAB_FILE; do + # fix permissions + chmod 0644 -- "$CRONTAB_FILE" + + # add newline, cron needs this + echo >> "$CRONTAB_FILE" + + # Install files + cp -a -- "$CRONTAB_FILE" "/etc/cron.d/$(basename "$CRONTAB_FILE")" + done +fi diff --git a/docker/php-official/8.6/conf/bin/service.d/cron.sh b/docker/php-official/8.6/conf/bin/service.d/cron.sh new file mode 100644 index 000000000..b5fa80dd3 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/cron.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_CRON_OPTS" ]]; then SERVICE_CRON_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/cron.d/" + +exec /usr/sbin/cron -f $SERVICE_CRON_OPTS diff --git a/docker/php-official/8.6/conf/bin/service.d/dnsmasq.d/10-init.sh b/docker/php-official/8.6/conf/bin/service.d/dnsmasq.d/10-init.sh new file mode 100644 index 000000000..836ebe2b5 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/dnsmasq.d/10-init.sh @@ -0,0 +1,37 @@ +# Create dnsmasq.d directory if not exists +mkdir -p -- /etc/dnsmasq.d/ + +# Enable /etc/dnsmasq.d/ +go-replace --mode=lineinfile --once \ + -s 'conf-dir' -r 'conf-dir=/etc/dnsmasq.d/,*.conf' \ + -- /etc/dnsmasq.conf + +## clear dns file +echo > /etc/dnsmasq.d/webdevops.conf + +if [ ! -f /etc/resolv.conf.original ]; then + cp -a /etc/resolv.conf /etc/resolv.conf.original + + ## set forward servers + cat /etc/resolv.conf.original | grep nameserver | sed 's/nameserver /server=/' > /etc/dnsmasq.d/forward.conf + + ## set dnsmasq to main nameserver + echo "nameserver 127.0.0.1" > /etc/resolv.conf +fi + + +# Add own VIRTUAL_HOST as loopback +if [[ -n "${VIRTUAL_HOST+x}" ]]; then + # split comma by space + VIRTUAL_HOST_LIST=${VIRTUAL_HOST//,/$'\n'} + + # replace *.domain for dns specific .domain wildcard + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/\*./.} + + # no support for .* + VIRTUAL_HOST_LIST=${VIRTUAL_HOST_LIST/.\*/.} + + for DOMAIN in $VIRTUAL_HOST_LIST; do + echo "address=/${DOMAIN}/127.0.0.1" >> /etc/dnsmasq.d/webdevops.conf + done +fi diff --git a/docker/php-official/8.6/conf/bin/service.d/dnsmasq.sh b/docker/php-official/8.6/conf/bin/service.d/dnsmasq.sh new file mode 100644 index 000000000..b8b4c12e0 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/dnsmasq.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_DNSMASQ_OPTS" ]]; then SERVICE_DNSMASQ_OPTS=""; fi +if [[ -z "$SERVICE_DNSMASQ_USER" ]]; then SERVICE_DNSMASQ_USER="root"; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/dnsmasq.d/" + +exec dnsmasq --keep-in-foreground --user="$SERVICE_DNSMASQ_USER" $SERVICE_DNSMASQ_OPTS diff --git a/docker/php-official/8.6/conf/bin/service.d/php-fpm.d/10-init.sh b/docker/php-official/8.6/conf/bin/service.d/php-fpm.d/10-init.sh new file mode 100644 index 000000000..7d0dadad6 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/php-fpm.d/10-init.sh @@ -0,0 +1,12 @@ +# setup user env +FPM_POOL_CONF="/opt/docker/etc/php/fpm/pool.d/application.conf" + +## Setup container uid +if [[ -n "$CONTAINER_UID" ]]; then + echo "Setting php-fpm user to $CONTAINER_UID" + go-replace --mode=line --regex \ + -s '^[\s;]*user[\s]*=' -r "user = $CONTAINER_UID" \ + -s '^[\s;]*group[\s]*=' -r "group = $CONTAINER_UID" \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' +fi diff --git a/docker/php-official/8.6/conf/bin/service.d/php-fpm.sh b/docker/php-official/8.6/conf/bin/service.d/php-fpm.sh new file mode 100644 index 000000000..15374f566 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/php-fpm.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_PHPFPM_OPTS" ]]; then SERVICE_PHPFPM_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/php-fpm.d/" + +exec /usr/local/bin/php-fpm --nodaemonize $SERVICE_PHPFPM_OPTS diff --git a/docker/php-official/8.6/conf/bin/service.d/postfix.d/10-init.sh b/docker/php-official/8.6/conf/bin/service.d/postfix.d/10-init.sh new file mode 100644 index 000000000..82574153d --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/postfix.d/10-init.sh @@ -0,0 +1,30 @@ +# force new copy of hosts there (otherwise links could be outdated) +mkdir -p /var/spool/postfix/etc +cp -f /etc/hosts /var/spool/postfix/etc/hosts +cp -f /etc/resolv.conf /var/spool/postfix/etc/resolv.conf +cp -f /etc/services /var/spool/postfix/etc/services + +go-replace --mode=line --regex -s '^[\s]*myhostname[\s]*=.*' -r "myhostname = $HOSTNAME" + +# General +go-replace --mode=lineinfile --regex \ + -s '^[\s]*myhostname[\s]*=.*.*' -r "myhostname = $HOSTNAME" \ + -s '^[\s]*inet_interfaces[\s]*=.*' -r "inet_interfaces = 127.0.0.1" \ + -- /etc/postfix/main.cf + +## REPLAYHOST +if [[ -n "${POSTFIX_RELAYHOST+x}" ]]; then + go-replace --mode=lineinfile --regex \ + -s '^[\s]*relayhost[\s]*=.*' -r "relayhost = $POSTFIX_RELAYHOST" \ + -- /etc/postfix/main.cf +fi + +## MYNETWORKS +if [[ -n "${POSTFIX_MYNETWORKS+x}" ]]; then + go-replace --mode=lineinfile --regex \ + -s '^[\s]*mynetworks[\s]*=.*' -r "mynetworks = $POSTFIX_MYNETWORKS" \ + -- /etc/postfix/main.cf +fi + +# generate aliases db +newaliases || : diff --git a/docker/php-official/8.6/conf/bin/service.d/postfix.sh b/docker/php-official/8.6/conf/bin/service.d/postfix.sh new file mode 100644 index 000000000..b9e477bcd --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/postfix.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# postfix-wrapper.sh, version 0.1.0 +# +# You cannot start postfix in some foreground mode and +# it's more or less important that docker doesn't kill +# postfix and its chilren if you stop the container. +# +# Use this script with supervisord and it will take +# care about starting and stopping postfix correctly. +# +# supervisord config snippet for postfix-wrapper: +# +# [program:postfix] +# process_name = postfix +# command = /path/to/postfix-wrapper.sh +# startsecs = 0 +# autorestart = false +# + +# Init vars +if [[ -z "$SERVICE_POSTFIX_OPTS" ]]; then SERVICE_POSTFIX_OPTS=""; fi + +source /opt/docker/bin/config.sh + +trap "postfix stop" SIGINT +trap "postfix stop" SIGTERM +trap "postfix reload" SIGHUP + +includeScriptDir "/opt/docker/bin/service.d/postfix.d/" + +# start postfix +postfix start $SERVICE_POSTFIX_OPTS + +# lets give postfix some time to start +sleep 3 + +# wait until postfix is dead (triggered by trap) +if [[ -f /var/spool/postfix/pid/master.pid ]]; then + while kill -0 "$(cat /var/spool/postfix/pid/master.pid 2>/dev/null)" &>/dev/null; do + sleep 5 + done +fi diff --git a/docker/php-official/8.6/conf/bin/service.d/ssh.d/10-init.sh b/docker/php-official/8.6/conf/bin/service.d/ssh.d/10-init.sh new file mode 100644 index 000000000..f2b600312 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/ssh.d/10-init.sh @@ -0,0 +1,7 @@ +# Init ssh privilege separation directory +mkdir -p /var/run/sshd +chown root:root /var/run/sshd +chmod 755 /var/run/sshd + +# generate host keys +ssh-keygen -A diff --git a/docker/php-official/8.6/conf/bin/service.d/ssh.sh b/docker/php-official/8.6/conf/bin/service.d/ssh.sh new file mode 100644 index 000000000..f01e87ab3 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/ssh.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_SSH_OPTS" ]]; then SERVICE_SSH_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/ssh.d/" + +exec /usr/sbin/sshd -D $SERVICE_SSH_OPTS diff --git a/docker/php-official/8.6/conf/bin/service.d/supervisor.d/10-init.sh b/docker/php-official/8.6/conf/bin/service.d/supervisor.d/10-init.sh new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/supervisor.d/10-init.sh @@ -0,0 +1 @@ +# placeholder diff --git a/docker/php-official/8.6/conf/bin/service.d/supervisor.sh b/docker/php-official/8.6/conf/bin/service.d/supervisor.sh new file mode 100644 index 000000000..5a82a13ff --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/supervisor.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_SUPERVISOR_OPTS" ]]; then SERVICE_SUPERVISOR_OPTS=""; fi +if [[ -z "$SERVICE_SUPERVISOR_USER" ]]; then SERVICE_SUPERVISOR_USER="root"; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/supervisor.d/" + +exec supervisord -c /opt/docker/etc/supervisor.conf --logfile /dev/null --pidfile /dev/null --user "$SERVICE_SUPERVISOR_USER" $SERVICE_SUPERVISOR_OPTS diff --git a/docker/php-official/8.6/conf/bin/service.d/syslog-ng.d/10-init.sh b/docker/php-official/8.6/conf/bin/service.d/syslog-ng.d/10-init.sh new file mode 100644 index 000000000..326207e52 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/syslog-ng.d/10-init.sh @@ -0,0 +1,10 @@ +# If /dev/log is either a named pipe or it was placed there accidentally, +# e.g. because of the issue documented at https://github.com/phusion/baseimage-docker/pull/25, +# then we remove it. +if [ ! -S /dev/log ]; then rm -f /dev/log; fi +if [ ! -S /var/lib/syslog-ng/syslog-ng.ctl ]; then rm -f /var/lib/syslog-ng/syslog-ng.ctl; fi + +if [[ ! -p /docker.stdout ]]; then + # Switch to file (tty docker mode) + go-replace -s 'pipe("/docker.stdout")' -r 'file("/docker.stdout")' -- /opt/docker/etc/syslog-ng/syslog-ng.conf +fi diff --git a/docker/php-official/8.6/conf/bin/service.d/syslog-ng.sh b/docker/php-official/8.6/conf/bin/service.d/syslog-ng.sh new file mode 100644 index 000000000..8e1358c1b --- /dev/null +++ b/docker/php-official/8.6/conf/bin/service.d/syslog-ng.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Init vars +if [[ -z "$SERVICE_SYSLOG_OPTS" ]]; then SERVICE_SYSLOG_OPTS=""; fi + +source /opt/docker/bin/config.sh + +includeScriptDir "/opt/docker/bin/service.d/syslog-ng.d/" + +exec syslog-ng -F --no-caps -p /var/run/syslog-ng.pid $SYSLOGNG_OPTS $SERVICE_SYSLOG_OPTS diff --git a/docker/php-official/8.6/conf/bin/usr-bin/container-file-auto-restore b/docker/php-official/8.6/conf/bin/usr-bin/container-file-auto-restore new file mode 100644 index 000000000..a41fcb3c8 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/usr-bin/container-file-auto-restore @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +set -o pipefail ## trace ERR through pipes +set -o errtrace ## trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +if [[ "$#" -ne 1 ]]; then + echo "Usage: $0 " + exit 1 +fi + +SOURCE_FILE="$1" +BACKUP_FILE="$(dirname "$1")/.$(basename "$1").bak" + +if [[ -f "$BACKUP_FILE" ]]; then + ## Backup file exists + ## -> container was restarted + ## -> restoring configuration + cp -a -- "$BACKUP_FILE" "$SOURCE_FILE" +else + ## Backup file DOESN'T exists + ## -> container first startup + ## -> backup configuration + cp -a -- "$SOURCE_FILE" "$BACKUP_FILE" +fi diff --git a/docker/php-official/8.6/conf/bin/usr-bin/docker-cronjob b/docker/php-official/8.6/conf/bin/usr-bin/docker-cronjob new file mode 100644 index 000000000..2746c75f5 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/usr-bin/docker-cronjob @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +source /opt/docker/bin/config.sh + +rootCheck "$0" + +if [[ "$#" -eq 0 ]]; then + echo "Usage: $0 ''" + exit 1 +fi + +# create crontab file +touch /etc/cron.d/webdevops-docker +chmod 0644 /etc/cron.d/webdevops-docker + +for CRONJOB_LINES in "$@"; do + echo "$CRONJOB_LINES" >> /etc/cron.d/webdevops-docker +done + +# Add required newline at end +echo >> /etc/cron.d/webdevops-docker diff --git a/docker/php-official/8.6/conf/bin/usr-bin/docker-php-setting b/docker/php-official/8.6/conf/bin/usr-bin/docker-php-setting new file mode 100644 index 000000000..30bbb979f --- /dev/null +++ b/docker/php-official/8.6/conf/bin/usr-bin/docker-php-setting @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +# Defaults +PHP_INI_FILE="/opt/docker/etc/php/php.ini" +PHP_VALUE_RAW=0 +PHP_KEY= +PHP_VALUE= + +for arg in "$@"; do + case "$arg" in + --raw) + PHP_VALUE_RAW=1 + shift + ;; + esac +done + +if [[ "$#" -le 2 ]]; then + echo "Usage: $(basename "$0") [--raw] " + exit 1 +fi + +PHP_SETTING_KEY=$1 +shift +PHP_SETTING_VALUE="$@" + +if [[ "$PHP_VALUE_RAW" -eq 0 ]]; then + case "$PHP_SETTING_VALUE" in + ''|*[!0-9]*) + # non numeric + PHP_SETTING_VALUE="\"${PHP_SETTING_VALUE}\"" + ;; + esac +fi + + +echo "$(basename "$0"): Setting php setting: ${PHP_SETTING_KEY} = ${PHP_SETTING_VALUE}" +echo "${PHP_SETTING_KEY} = ${PHP_SETTING_VALUE}" >> "$PHP_INI_FILE" + diff --git a/docker/php-official/8.6/conf/bin/usr-bin/docker-service b/docker/php-official/8.6/conf/bin/usr-bin/docker-service new file mode 100644 index 000000000..70a493767 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/usr-bin/docker-service @@ -0,0 +1,89 @@ +#!/usr/bin/env bash + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +if [[ "$#" -le 1 ]]; then + echo "Usage: $0 " + exit 1 +fi + +SERVICE_COMMAND=$1 +shift + +for SERVICE in "$@"; do + RUN_FILE="/opt/docker/bin/service.d/${SERVICE}.sh" + SERVICE_FILE="/opt/docker/etc/supervisor.d/${SERVICE}.conf" + PROVISION_FILE="/opt/docker/provision/service.d/${SERVICE}.sh" + + case "$SERVICE_COMMAND" in + enable) + # Run on demand installation/provisioning + if [[ -f "$PROVISION_FILE" ]]; then + echo "Running provisioning for ${SERVICE}, please wait..." + + ## execute scripts + . "$PROVISION_FILE" + + ## remove directory (one run time) + rm -f -- "$PROVISION_FILE" + fi + + ## Enable service + if [[ -f "$SERVICE_FILE" ]]; then + go-replace --mode=lineinfile \ + -s 'autostart =' -r 'autostart = true' \ + -- "$SERVICE_FILE" + else + echo "[ERROR] Service '${SERVICE}' not found (tried ${SERVICE_FILE})" + exit 1 + fi + ;; + + disable) + ## Disable service + if [[ -f "$SERVICE_FILE" ]]; then + go-replace --mode=lineinfile \ + -s 'autostart =' -r 'autostart = false' \ + -- "$SERVICE_FILE" + else + echo "[ERROR] Service '${SERVICE}' not found (tried ${SERVICE_FILE})" + exit 1 + fi + ;; + + install) + # Run on demand installation/provisioning + if [[ -f "$PROVISION_FILE" ]]; then + echo "Running provisioning for ${SERVICE}, please wait..." + + ## execute scripts + . "$PROVISION_FILE" + + ## remove directory (one run time) + rm -f -- "$PROVISION_FILE" + fi + ;; + + run) + if [[ -f "$RUN_FILE" ]]; then + exec "$RUN_FILE" + else + echo "[ERROR] Service '${SERVICE}' not found (tried ${RUN_FILE})" + exit 1 + fi + ;; + + stop|start|restart|status|pid|check) + service "${SERVICE}" "$SERVICE_COMMAND" + ;; + + *) + echo "[ERROR] $SERVICE_COMMAND is not a valid command" + exit 1 + ;; + esac +done + diff --git a/docker/php-official/8.6/conf/bin/usr-bin/docker-service-disable b/docker/php-official/8.6/conf/bin/usr-bin/docker-service-disable new file mode 100644 index 000000000..991f249c8 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/usr-bin/docker-service-disable @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +exec docker-service disable "$@" diff --git a/docker/php-official/8.6/conf/bin/usr-bin/docker-service-enable b/docker/php-official/8.6/conf/bin/usr-bin/docker-service-enable new file mode 100644 index 000000000..da99c9aeb --- /dev/null +++ b/docker/php-official/8.6/conf/bin/usr-bin/docker-service-enable @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +exec docker-service enable "$@" + diff --git a/docker/php-official/8.6/conf/bin/usr-bin/service b/docker/php-official/8.6/conf/bin/usr-bin/service new file mode 100755 index 000000000..69874cb80 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/usr-bin/service @@ -0,0 +1,86 @@ +#!/usr/bin/env bash + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +# Root check +if [ "$(/usr/bin/whoami)" != "root" ]; then + echo "[ERROR] Must be run as root" + exit 1 +fi + +function serviceHelp() { + echo "Usage: $(basename "$0") " +} + +function getServicePid() { + local serviceName="$1" + local servicePid=$(supervisorctl pid "${serviceName}:${serviceName}d") + + if [[ -z "$servicePid" ]] || [[ "$servicePid" == "0" ]]; then + echo "not running" + exit 1 + fi + + echo $servicePid +} + +# Param check +if [ "$#" -lt 2 ]; then + echo "[ERROR] Missing parameters" + serviceHelp + exit 1 +fi + +############################# +# Param init +############################# + +SERVICENAME="$1" +ACTION="$2" + +############################# +# Service aliases +############################# +case "$SERVICENAME" in + apache2|httpd) + SERVICENAME="apache" + ;; +esac + +############################# +# Action runner +############################# +case "$ACTION" in + stop|start|restart|status) + exec supervisorctl "$ACTION" "${SERVICENAME}:${SERVICENAME}d" + ;; + + pid) + echo $(getServicePid "${SERVICENAME}") + ;; + + check) + FIRST_PID=$(getServicePid "${SERVICENAME}") + sleep 5 + SECOND_PID=$(getServicePid "${SERVICENAME}") + + if [[ "$FIRST_PID" == "$SECOND_PID" ]]; then + echo "ok" + exit 0 + else + echo "not running" + exit 1 + fi + ;; + + + *) + echo "[ERROR] Invalid action" + serviceHelp + exit 1 + ;; + +esac diff --git a/docker/php-official/8.6/conf/bin/usr-bin/version-compare b/docker/php-official/8.6/conf/bin/usr-bin/version-compare new file mode 100644 index 000000000..ca450b0e9 --- /dev/null +++ b/docker/php-official/8.6/conf/bin/usr-bin/version-compare @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +set -o pipefail # trace ERR through pipes +set -o errtrace # trace ERR through 'time command' and other functions +set -o nounset ## set -u : exit the script if you try to use an uninitialised variable +set -o errexit ## set -e : exit the script if any statement returns a non-true return value + +function versionCompare () { + if [[ $1 == $2 ]] + then + echo -n '=' + return + fi + local IFS=. + local i ver1=($1) ver2=($2) + # fill empty fields in ver1 with zeros + for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) + do + ver1[i]=0 + done + for ((i=0; i<${#ver1[@]}; i++)) + do + if [[ -z ${ver2[i]} ]] + then + # fill empty fields in ver2 with zeros + ver2[i]=0 + fi + if ((10#${ver1[i]} > 10#${ver2[i]})) + then + echo -n '>' + return + fi + if ((10#${ver1[i]} < 10#${ver2[i]})) + then + echo -n '<' + return + fi + done + + echo -n '=' +} + +versionCompare "$1" "$2" diff --git a/docker/php-official/8.6/conf/etc/cron/.gitkeep b/docker/php-official/8.6/conf/etc/cron/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6/conf/etc/logrotate.d/syslog-ng b/docker/php-official/8.6/conf/etc/logrotate.d/syslog-ng new file mode 100644 index 000000000..4a6f9c54e --- /dev/null +++ b/docker/php-official/8.6/conf/etc/logrotate.d/syslog-ng @@ -0,0 +1,38 @@ +/var/log/syslog +{ + rotate 7 + daily + missingok + notifempty + delaycompress + compress + postrotate + /bin/kill -HUP `cat /var/run/syslog-ng.pid 2> /dev/null` > /dev/null + endscript +} + +/var/log/mail.info +/var/log/mail.warn +/var/log/mail.err +/var/log/mail.log +/var/log/daemon.log +/var/log/kern.log +/var/log/auth.log +/var/log/user.log +/var/log/lpr.log +/var/log/cron.log +/var/log/debug +/var/log/messages +{ + rotate 4 + weekly + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + /bin/kill -HUP `cat /var/run/syslog-ng.pid 2> /dev/null` > /dev/null + supervisorctl restart syslog-ng-stdout > /dev/null + endscript +} \ No newline at end of file diff --git a/docker/php-official/8.6/conf/etc/php/conf.d/.gitkeep b/docker/php-official/8.6/conf/etc/php/conf.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6/conf/etc/php/fpm/.gitkeep b/docker/php-official/8.6/conf/etc/php/fpm/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6/conf/etc/php/php.ini b/docker/php-official/8.6/conf/etc/php/php.ini new file mode 100644 index 000000000..447212118 --- /dev/null +++ b/docker/php-official/8.6/conf/etc/php/php.ini @@ -0,0 +1 @@ +; placeholder diff --git a/docker/php-official/8.6/conf/etc/php/php.webdevops.ini b/docker/php-official/8.6/conf/etc/php/php.webdevops.ini new file mode 100644 index 000000000..829c21e23 --- /dev/null +++ b/docker/php-official/8.6/conf/etc/php/php.webdevops.ini @@ -0,0 +1,36 @@ +; ------------------------------------- +; Docker Webdevops PHP configuration +; ------------------------------------- + +; this file will overwrite default php.ini settings + +display_errors = 0 +log_errors = 1 + +short_open_tag = Off +variables_order = 'GPCS' +request_order = 'GP' + +allow_url_fopen = On +allow_url_include = Off + +; Enable session-based upload progress only when an application needs it. +session.upload_progress.enabled = Off + +memory_limit = 512M +max_execution_time = 300 +max_input_time = 300 +post_max_size = 50M +upload_max_filesize = 50M +max_input_vars = 5000 + +expose_php = Off + +date.timezone = UTC + +mysql.default_host = mysql +mysqli.default_host = mysql + +opcache.memory_consumption = 256 +opcache.interned_strings_buffer = 16 +opcache.max_accelerated_files = 7963 diff --git a/docker/php-official/8.6/conf/etc/supervisor.conf b/docker/php-official/8.6/conf/etc/supervisor.conf new file mode 100644 index 000000000..479e0db08 --- /dev/null +++ b/docker/php-official/8.6/conf/etc/supervisor.conf @@ -0,0 +1,20 @@ +[supervisord] +nodaemon=true + +[unix_http_server] +file = /.supervisor.sock +chmod = 0700 +chown = root:root +username = root +password = {SHA}e982f17bcbe0f724063b708a4f76db211a999304 + +[supervisorctl] +serverurl = unix:///.supervisor.sock +username = root +password = docker + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[include] +files = /opt/docker/etc/supervisor.d/*.conf diff --git a/docker/php-official/8.6/conf/etc/supervisor.d/.gitkeep b/docker/php-official/8.6/conf/etc/supervisor.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6/conf/etc/supervisor.d/cron.conf b/docker/php-official/8.6/conf/etc/supervisor.d/cron.conf new file mode 100644 index 000000000..ef0a71678 --- /dev/null +++ b/docker/php-official/8.6/conf/etc/supervisor.d/cron.conf @@ -0,0 +1,14 @@ +[group:cron] +programs=crond +priority=25 + +[program:crond] +command = /opt/docker/bin/service.d/cron.sh +process_name=%(program_name)s +startsecs = 0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-official/8.6/conf/etc/supervisor.d/dnsmasq.conf b/docker/php-official/8.6/conf/etc/supervisor.d/dnsmasq.conf new file mode 100644 index 000000000..9832ffca7 --- /dev/null +++ b/docker/php-official/8.6/conf/etc/supervisor.d/dnsmasq.conf @@ -0,0 +1,14 @@ +[group:dnsmasq] +programs=dnsmasqd +priority=15 + +[program:dnsmasqd] +command = /opt/docker/bin/service.d/dnsmasq.sh +process_name=%(program_name)s +startsecs = 0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-official/8.6/conf/etc/supervisor.d/php-fpm.conf b/docker/php-official/8.6/conf/etc/supervisor.d/php-fpm.conf new file mode 100644 index 000000000..5781f5b0a --- /dev/null +++ b/docker/php-official/8.6/conf/etc/supervisor.d/php-fpm.conf @@ -0,0 +1,15 @@ +[group:php-fpm] +programs=php-fpmd +priority=20 + +[program:php-fpmd] +command = /opt/docker/bin/service.d/php-fpm.sh +process_name=%(program_name)s +startsecs = 0 +autostart = true +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 + diff --git a/docker/php-official/8.6/conf/etc/supervisor.d/postfix.conf b/docker/php-official/8.6/conf/etc/supervisor.d/postfix.conf new file mode 100644 index 000000000..b8d70bb40 --- /dev/null +++ b/docker/php-official/8.6/conf/etc/supervisor.d/postfix.conf @@ -0,0 +1,15 @@ +[group:postfix] +programs=postfixd +priority=30 + +[program:postfixd] +directory = /etc/postfix +command = /opt/docker/bin/service.d/postfix.sh +process_name=%(program_name)s +startsecs = 0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-official/8.6/conf/etc/supervisor.d/ssh.conf b/docker/php-official/8.6/conf/etc/supervisor.d/ssh.conf new file mode 100644 index 000000000..0ecd798d6 --- /dev/null +++ b/docker/php-official/8.6/conf/etc/supervisor.d/ssh.conf @@ -0,0 +1,14 @@ +[group:ssh] +programs=sshd +priority=30 + +[program:sshd] +command = /opt/docker/bin/service.d/ssh.sh +process_name=%(program_name)s +startsecs=0 +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-official/8.6/conf/etc/supervisor.d/syslog.conf b/docker/php-official/8.6/conf/etc/supervisor.d/syslog.conf new file mode 100644 index 000000000..20d1e238c --- /dev/null +++ b/docker/php-official/8.6/conf/etc/supervisor.d/syslog.conf @@ -0,0 +1,13 @@ +[group:syslog] +programs=syslogd +priority=10 + +[program:syslogd] +command = /opt/docker/bin/service.d/syslog-ng.sh +process_name=%(program_name)s +autostart = false +autorestart = true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker/php-official/8.6/conf/etc/syslog-ng/syslog-ng.conf b/docker/php-official/8.6/conf/etc/syslog-ng/syslog-ng.conf new file mode 100644 index 000000000..c69841581 --- /dev/null +++ b/docker/php-official/8.6/conf/etc/syslog-ng/syslog-ng.conf @@ -0,0 +1,48 @@ +@version: 3.5 + +template t_isostamp { + # syslog-t_isostamp START + template("[SYSLOG] $MSGHDR$MSG\n"); + # syslog-t_isostamp END +}; + +options { + # syslog-options START + file-template(t_isostamp); + chain_hostnames(off); + flush_lines(0); + use-dns(no); + use_fqdn(no); + owner("root"); + group("adm"); + perm(0640); + stats_freq(0); + # syslog-options START +}; + +source s_src { + # syslog-s_src START + unix-stream("/dev/log"); + internal(); + # syslog-s_src END +}; + +filter f_filter { + # syslog-f_filter START + not facility(auth, authpriv); + # syslog-f_filter END +}; + +destination d_all { + # syslog-d_all START + pipe("/docker.stdout"); + # syslog-d_all END +}; + +log { + # syslog-log START + source(s_src); + filter(f_filter); + destination(d_all); + # syslog-log START +}; diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/.gitkeep b/docker/php-official/8.6/conf/provision/bootstrap.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/10-entrypoint.sh b/docker/php-official/8.6/conf/provision/bootstrap.d/10-entrypoint.sh new file mode 100644 index 000000000..413e7b37c --- /dev/null +++ b/docker/php-official/8.6/conf/provision/bootstrap.d/10-entrypoint.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Link main entrypoint script to /entrypoint +ln -sf /opt/docker/bin/entrypoint.sh /entrypoint + +# Link entrypoint cmd shortcut conf directory to /entrypoint.cmd +ln -sf /opt/docker/bin/entrypoint.d /entrypoint.cmd + +# Create /entrypoint.d +mkdir -p /entrypoint.d +chmod 700 /entrypoint.d +chown root:root /entrypoint.d + + diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/10-permissions.sh b/docker/php-official/8.6/conf/provision/bootstrap.d/10-permissions.sh new file mode 100644 index 000000000..20d602bdd --- /dev/null +++ b/docker/php-official/8.6/conf/provision/bootstrap.d/10-permissions.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash + diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/10-php-init.sh b/docker/php-official/8.6/conf/provision/bootstrap.d/10-php-init.sh new file mode 100644 index 000000000..72d9f2454 --- /dev/null +++ b/docker/php-official/8.6/conf/provision/bootstrap.d/10-php-init.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/10-supervisor.sh b/docker/php-official/8.6/conf/provision/bootstrap.d/10-supervisor.sh new file mode 100644 index 000000000..311daee4c --- /dev/null +++ b/docker/php-official/8.6/conf/provision/bootstrap.d/10-supervisor.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Remove /usr/sbin/service (images have custom service script) +rm -rf /usr/sbin/service + +# Remove existing supervisor configuration +rm -rf -- /etc/supervisor* + +# Link supervisor configuration script +ln -sf /opt/docker/etc/supervisor.conf /etc/supervisord.conf diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/10-user-application.sh b/docker/php-official/8.6/conf/provision/bootstrap.d/10-user-application.sh new file mode 100644 index 000000000..5bc865e80 --- /dev/null +++ b/docker/php-official/8.6/conf/provision/bootstrap.d/10-user-application.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Add group +groupadd -g "$APPLICATION_GID" "$APPLICATION_GROUP" + +# Add user +useradd -u "$APPLICATION_UID" --home "/home/application" --create-home --shell /bin/bash --no-user-group "$APPLICATION_USER" + +# Assign user to group +usermod -g "$APPLICATION_GROUP" "$APPLICATION_USER" diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/11-php-conf.sh b/docker/php-official/8.6/conf/provision/bootstrap.d/11-php-conf.sh new file mode 100644 index 000000000..7b8f6d3db --- /dev/null +++ b/docker/php-official/8.6/conf/provision/bootstrap.d/11-php-conf.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +PHP_ETC_DIR=/usr/local/etc/php +PHP_MAIN_CONF=/usr/local/etc/php-fpm.conf +PHP_POOL_CONF=www.conf +PHP_POOL_DIR=/usr/local/etc/php-fpm.d +PHP_FPM_BIN=/usr/local/sbin/php-fpm +PHP_MOD_INI_DIR=/usr/local/etc/php/conf.d diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/20-app.sh b/docker/php-official/8.6/conf/provision/bootstrap.d/20-app.sh new file mode 100644 index 000000000..749966b67 --- /dev/null +++ b/docker/php-official/8.6/conf/provision/bootstrap.d/20-app.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# Create /app folder +mkdir -p /app +chown "$APPLICATION_USER":"$APPLICATION_GROUP" /app diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/20-setup-php-fpm-pool.sh b/docker/php-official/8.6/conf/provision/bootstrap.d/20-setup-php-fpm-pool.sh new file mode 100644 index 000000000..c5d50e3ea --- /dev/null +++ b/docker/php-official/8.6/conf/provision/bootstrap.d/20-setup-php-fpm-pool.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# Rename pool file file to application.conf +if [[ ! -f "/opt/docker/etc/php/fpm/pool.d/application.conf" ]]; then + # Move php-fpm pool directory file to /opt/docker/etc/php/ + mv -- "$PHP_POOL_DIR" /opt/docker/etc/php/fpm/pool.d + + mv -- "/opt/docker/etc/php/fpm/pool.d/${PHP_POOL_CONF}" /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +# Remove php-fpm pool directory +rm -rf -- "$PHP_POOL_DIR" + +# Symlink php-fpm pool file to original destination +ln -sf -- /opt/docker/etc/php/fpm/pool.d "$PHP_POOL_DIR" + +# Configure php-fpm pool (application.conf) +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*catch_workers_output[\s]*=' -r 'catch_workers_output = yes' \ + -s '^[\s;]*access.format[\s]*=' -r 'access.format = "[php-fpm:access] %R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"' \ + -s '^[\s;]*access.log[\s]*=' -r 'access.log = /docker.stdout' \ + -s '^[\s;]*slowlog[\s]*=' -r 'slowlog = /docker.stderr' \ + -s '^[\s;]*php_admin_value\[error_log\][\s]*=' -r 'php_admin_value[error_log] = /docker.stderr' \ + -s '^[\s;]*php_admin_value\[log_errors\][\s]*=' -r 'php_admin_value[log_errors] = on' \ + -s '^[\s;]*listen.allowed_clients[\s]*=' -r ";listen.allowed_clients" \ + -- /opt/docker/etc/php/fpm/pool.d/application.conf + +# Fix user setting +go-replace --mode=line --regex \ + -s '^[\s;]*user[\s]*=' -r "user = $APPLICATION_USER" \ + -s '^[\s;]*group[\s]*=' -r "group = $APPLICATION_GROUP" \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' + +# Keep the environment variables of the container for PHP +go-replace --mode=lineinfile --regex \ + -s '^[\s;]*clear_env[\s]*=' -r 'clear_env = no' \ + -- /opt/docker/etc/php/fpm/pool.d/application.conf diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/20-setup-php-fpm.sh b/docker/php-official/8.6/conf/provision/bootstrap.d/20-setup-php-fpm.sh new file mode 100644 index 000000000..9f96894b1 --- /dev/null +++ b/docker/php-official/8.6/conf/provision/bootstrap.d/20-setup-php-fpm.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +# Link main php-fpm binary +ln -sf -- "$PHP_FPM_BIN" /usr/local/bin/php-fpm + +# Move php-fpm main file to /opt/docker/etc/php/fpm/ and create symlink +if [[ ! -f /opt/docker/etc/php/fpm/php-fpm.conf ]]; then + mv -- "$PHP_MAIN_CONF" /opt/docker/etc/php/fpm/php-fpm.conf +else + rm -f -- "$PHP_MAIN_CONF" +fi +ln -sf -- /opt/docker/etc/php/fpm/php-fpm.conf "$PHP_MAIN_CONF" + +# Configure php-fpm main (all versions) +go-replace --mode=lineinfile --regex \ + --lineinfile-after='\[global\]' \ + -s '^[\s;]*error_log[\s]*=' -r 'error_log = /docker.stderr' \ + -s '^[\s;]*pid[\s]*=' -r 'pid = /var/run/php-fpm.pid' \ + -- /opt/docker/etc/php/fpm/php-fpm.conf + +# Listen on port 9000 of all addresses: PHP-FPM binds to [::] (IPv6 and IPv4) +# and falls back to 0.0.0.0 if the container has no IPv6 +go-replace --mode=line --regex \ + -s '^[\s;]*listen[\s]*=' -r 'listen = 9000' \ + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/20-setup-php.sh b/docker/php-official/8.6/conf/provision/bootstrap.d/20-setup-php.sh new file mode 100644 index 000000000..c1e716300 --- /dev/null +++ b/docker/php-official/8.6/conf/provision/bootstrap.d/20-setup-php.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + # Register webdevops ini + ln -sf "/opt/docker/etc/php/php.webdevops.ini" "${PHP_ETC_DIR}/conf.d/98-webdevops.ini" + + # Register custom php ini + ln -sf "/opt/docker/etc/php/php.ini" "${PHP_ETC_DIR}/conf.d/99-docker.ini" + ;; +esac diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/30-setup-ioncube.sh b/docker/php-official/8.6/conf/provision/bootstrap.d/30-setup-ioncube.sh new file mode 100644 index 000000000..8d15159dc --- /dev/null +++ b/docker/php-official/8.6/conf/provision/bootstrap.d/30-setup-ioncube.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +if [ $IMAGE_FAMILY == "Alpine" ]; then + echo "Skipping ionCube installation on Alpine" + return +fi + +# The official PHP images are thread safe (ZTS) since PHP 8.6 and are built without +# Zend signals, which the ionCube ZTS loader needs (undefined zend_signal_globals_offset) +if [[ "$(php -n -r 'echo PHP_ZTS;')" == "1" ]]; then + echo "Skipping ionCube installation: the ionCube loader does not support this thread-safe PHP build" + return +fi + +echo "Installing ionCube loader" + +case "$(uname -m)" in + x86_64) IONCUBE_ARCH="x86-64" ;; + aarch64) IONCUBE_ARCH="aarch64" ;; + *) + echo "Skipping ionCube installation on unsupported architecture $(uname -m)" + return + ;; +esac + +DOWNLOAD_URL="https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${IONCUBE_ARCH}.tar.gz" +TMP_FILE="/tmp/ioncube_loaders.tar.gz" + +echo "Downloading ..." +curl -fsS "${DOWNLOAD_URL}" -o "${TMP_FILE}" +echo "Unpacking ..." +tar -xzf ${TMP_FILE} -C /tmp + +PHP_VERSION="$(php -n -r 'echo PHP_MAJOR_VERSION, ".", PHP_MINOR_VERSION;')" +PHP_EXTENSION_DIR="$(php -n -r 'echo ini_get("extension_dir");')" +MOD_INI="${PHP_MOD_INI_DIR}/00-ioncube.ini" +SO_FILE="${PHP_EXTENSION_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" + +echo "PHP-VERSION: ${PHP_VERSION}" +echo "PHP-EXTENSION-DIR: ${PHP_EXTENSION_DIR}" +if [[ ! -f "/tmp/ioncube/ioncube_loader_lin_${PHP_VERSION}.so" ]]; then + echo "There is no ioncube available for PHP${PHP_VERSION}, skipping installation" +else + echo "Installing ${SO_FILE}" + cp "/tmp/ioncube/ioncube_loader_lin_${PHP_VERSION}.so" ${SO_FILE} + + echo "Checking ionCube loader" + php -n -d "zend_extension=${SO_FILE}" -r 'exit(extension_loaded("ionCube Loader") ? 0 : 1);' || return 1 + + echo "Writing module ini" + echo "[ioncube]" > ${MOD_INI} + echo "zend_extension = ${SO_FILE}" >> ${MOD_INI} + echo "; priority=01" >> ${MOD_INI} + + echo "Enabling ionCube PHP module" + case "$IMAGE_FAMILY" in + Debian|Ubuntu) + # Enable ionCube (if available) + if [[ -f "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" ]]; then + ln -sf "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" "${PHP_ETC_DIR}/cli/conf.d/00-ioncube.ini" + ln -sf "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" "${PHP_ETC_DIR}/fpm/conf.d/00-ioncube.ini" + fi + ;; + esac +fi + +echo "Cleaning up" +rm -rf "$TMP_FILE" /tmp/ioncube diff --git a/docker/php-official/8.6/conf/provision/bootstrap.d/90-cleanup.sh b/docker/php-official/8.6/conf/provision/bootstrap.d/90-cleanup.sh new file mode 100644 index 000000000..3ca393da6 --- /dev/null +++ b/docker/php-official/8.6/conf/provision/bootstrap.d/90-cleanup.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Remove default cronjobs +rm -f -- \ + /etc/cron.daily/logrotate \ + /etc/cron.daily/apt-compat \ + /etc/cron.daily/dpkg \ + /etc/cron.daily/passwd \ + /etc/cron.daily/0yum-daily.cron \ + /etc/cron.daily/logrotate \ + /etc/cron.hourly/0yum-hourly.cron \ + /etc/periodic/daily/logrotate diff --git a/docker/php-official/8.6/conf/provision/build.d/.gitkeep b/docker/php-official/8.6/conf/provision/build.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6/conf/provision/build.d/10-cleanup.sh b/docker/php-official/8.6/conf/provision/build.d/10-cleanup.sh new file mode 100644 index 000000000..41031b784 --- /dev/null +++ b/docker/php-official/8.6/conf/provision/build.d/10-cleanup.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +## remove logs (each bootstrap) +rm -rf -- /var/log/* +rm -rf -- /var/tmp/* +rm -rf -- /tmp/* +rm -rf -- /root/.profile diff --git a/docker/php-official/8.6/conf/provision/entrypoint.d/.gitkeep b/docker/php-official/8.6/conf/provision/entrypoint.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6/conf/provision/entrypoint.d/05-permissions.sh b/docker/php-official/8.6/conf/provision/entrypoint.d/05-permissions.sh new file mode 100644 index 000000000..6f77d8e40 --- /dev/null +++ b/docker/php-official/8.6/conf/provision/entrypoint.d/05-permissions.sh @@ -0,0 +1,2 @@ +# Fix rights of /tmp (can be a volume) +chmod 1777 /tmp diff --git a/docker/php-official/8.6/conf/provision/entrypoint.d/20-php-fpm.sh b/docker/php-official/8.6/conf/provision/entrypoint.d/20-php-fpm.sh new file mode 100644 index 000000000..5ab722cf7 --- /dev/null +++ b/docker/php-official/8.6/conf/provision/entrypoint.d/20-php-fpm.sh @@ -0,0 +1,80 @@ +####################################### +### FPM MAIN +####################################### + +container-file-auto-restore "/opt/docker/etc/php/fpm/php-fpm.conf" + +echo '' >> /opt/docker/etc/php/fpm/php-fpm.conf +echo '; container env settings' >> /opt/docker/etc/php/fpm/php-fpm.conf +echo '[global]' >> /opt/docker/etc/php/fpm/php-fpm.conf + +if [[ -n "${FPM_PROCESS_MAX+x}" ]]; then + echo "process.max = ${FPM_PROCESS_MAX}" >> /opt/docker/etc/php/fpm/php-fpm.conf +fi + +# General fpm main setting +for ENV_VAR in $(envListVars "fpm\.global\."); do + env_key=${ENV_VAR#fpm.global.} + env_val=$(envGetValue "$ENV_VAR") + + echo "$env_key = ${env_val}" >> /opt/docker/etc/php/fpm/php-fpm.conf +done + +####################################### +### FPM POOL +####################################### + +container-file-auto-restore "/opt/docker/etc/php/fpm/pool.d/application.conf" + +echo '' >> /opt/docker/etc/php/fpm/pool.d/application.conf +echo '; container env settings' >> /opt/docker/etc/php/fpm/pool.d/application.conf + +# General fpm pool setting +for ENV_VAR in $(envListVars "fpm\.pool\."); do + env_key=${ENV_VAR#fpm.pool.} + env_val=$(envGetValue "$ENV_VAR") + + echo "$env_key = ${env_val}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +done + + +if [[ -n "${FPM_PM_MAX_CHILDREN+x}" ]]; then + echo "pm.max_children = ${FPM_PM_MAX_CHILDREN}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_PM_START_SERVERS+x}" ]]; then + echo "pm.start_servers = ${FPM_PM_START_SERVERS}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_PM_MIN_SPARE_SERVERS+x}" ]]; then + echo "pm.min_spare_servers = ${FPM_PM_MIN_SPARE_SERVERS}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_PM_MAX_SPARE_SERVERS+x}" ]]; then + echo "pm.max_spare_servers = ${FPM_PM_MAX_SPARE_SERVERS}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_PROCESS_IDLE_TIMEOUT+x}" ]]; then + echo "pm.process_idle_timeout = ${FPM_PROCESS_IDLE_TIMEOUT}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_MAX_REQUESTS+x}" ]]; then + echo "pm.max_requests = ${FPM_MAX_REQUESTS}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_REQUEST_TERMINATE_TIMEOUT+x}" ]]; then + echo "request_terminate_timeout = ${FPM_REQUEST_TERMINATE_TIMEOUT}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_RLIMIT_FILES+x}" ]]; then + echo "rlimit_files = ${FPM_RLIMIT_FILES}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +if [[ -n "${FPM_RLIMIT_CORE+x}" ]]; then + echo "rlimit_core = ${FPM_RLIMIT_CORE}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi + +# Workaround for official PHP images +if [[ -n "${PHP_SENDMAIL_PATH+x}" ]]; then + echo "php_admin_value[sendmail_path] = ${PHP_SENDMAIL_PATH}" >> /opt/docker/etc/php/fpm/pool.d/application.conf +fi diff --git a/docker/php-official/8.6/conf/provision/entrypoint.d/20-php.sh b/docker/php-official/8.6/conf/provision/entrypoint.d/20-php.sh new file mode 100644 index 000000000..2e208fb85 --- /dev/null +++ b/docker/php-official/8.6/conf/provision/entrypoint.d/20-php.sh @@ -0,0 +1,75 @@ +container-file-auto-restore "/opt/docker/etc/php/php.webdevops.ini" + +echo '' >> /opt/docker/etc/php/php.webdevops.ini +echo '; container env settings' >> /opt/docker/etc/php/php.webdevops.ini + +# General php setting +for ENV_VAR in $(envListVars "php\."); do + env_key=${ENV_VAR#php.} + env_val=$(envGetValue "$ENV_VAR") + + echo "$env_key = ${env_val}" >> /opt/docker/etc/php/php.webdevops.ini +done + + +if [[ -n "${PHP_DATE_TIMEZONE+x}" ]]; then + echo "date.timezone = ${PHP_DATE_TIMEZONE}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_DISPLAY_ERRORS+x}" ]]; then + echo "display_errors = ${PHP_DISPLAY_ERRORS}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_MEMORY_LIMIT+x}" ]]; then + echo "memory_limit = ${PHP_MEMORY_LIMIT}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_MAX_EXECUTION_TIME+x}" ]]; then + echo "max_execution_time = ${PHP_MAX_EXECUTION_TIME}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_POST_MAX_SIZE+x}" ]]; then + echo "post_max_size = ${PHP_POST_MAX_SIZE}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_UPLOAD_MAX_FILESIZE+x}" ]]; then + echo "upload_max_filesize = ${PHP_UPLOAD_MAX_FILESIZE}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_OPCACHE_MEMORY_CONSUMPTION+x}" ]]; then + echo "opcache.memory_consumption = ${PHP_OPCACHE_MEMORY_CONSUMPTION}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_OPCACHE_MAX_ACCELERATED_FILES+x}" ]]; then + echo "opcache.max_accelerated_files = ${PHP_OPCACHE_MAX_ACCELERATED_FILES}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_OPCACHE_VALIDATE_TIMESTAMPS+x}" ]]; then + echo "opcache.validate_timestamps = ${PHP_OPCACHE_VALIDATE_TIMESTAMPS}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_OPCACHE_REVALIDATE_FREQ+x}" ]]; then + echo "opcache.revalidate_freq = ${PHP_OPCACHE_REVALIDATE_FREQ}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +if [[ -n "${PHP_OPCACHE_INTERNED_STRINGS_BUFFER+x}" ]]; then + echo "opcache.interned_strings_buffer = ${PHP_OPCACHE_INTERNED_STRINGS_BUFFER}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +# Workaround for official PHP images +if [[ -n "${PHP_SENDMAIL_PATH+x}" ]]; then + echo "sendmail_path = ${PHP_SENDMAIL_PATH}" >> /opt/docker/etc/php/php.webdevops.ini +fi + +# Disable all PHP mods specified in PHP_DISMOD as comma separated list +if [[ -n "${PHP_DISMOD+x}" ]]; then + ini_dir_cli=$(php -i | grep 'Scan this dir for additional .ini files' | cut -c44-) + ini_dir_fpm=$(php-fpm -i | grep 'Scan this dir for additional .ini files' | cut -c44-) + for DISABLE_MOD in ${PHP_DISMOD//,/ }; do + rm -f ${ini_dir_cli}/*${DISABLE_MOD}* + rm -f ${ini_dir_fpm}/*${DISABLE_MOD}* + done +fi + +# Link composer version accordingly +ln -sf /usr/local/bin/composer${COMPOSER_VERSION:-2} /usr/local/bin/composer diff --git a/docker/php-official/8.6/conf/provision/service.d/.gitkeep b/docker/php-official/8.6/conf/provision/service.d/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/docker/php-official/8.6/conf/provision/service.d/cron.sh b/docker/php-official/8.6/conf/provision/service.d/cron.sh new file mode 100644 index 000000000..bd8a54781 --- /dev/null +++ b/docker/php-official/8.6/conf/provision/service.d/cron.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + apt-install cron + ;; + + RedHat) + yum-install cronie + ;; +esac diff --git a/docker/php-official/8.6/conf/provision/service.d/dnsmasq.sh b/docker/php-official/8.6/conf/provision/service.d/dnsmasq.sh new file mode 100644 index 000000000..9e5c3228c --- /dev/null +++ b/docker/php-official/8.6/conf/provision/service.d/dnsmasq.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +# Installation +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + apt-install dnsmasq + ;; + + RedHat) + yum-install dnsmasq + ;; + + Alpine) + apk-install dnsmasq + ;; +esac + +# Configuration +go-replace --mode=line \ + -s '^[\s]*user[\s]*=' -r 'user = root' \ + -s '^[\s]*conf-dir[\s]*=' -r 'conf-dir = /etc/dnsmasq.d' \ + -- /etc/dnsmasq.conf diff --git a/docker/php-official/8.6/conf/provision/service.d/postfix.sh b/docker/php-official/8.6/conf/provision/service.d/postfix.sh new file mode 100644 index 000000000..a8c7cc61b --- /dev/null +++ b/docker/php-official/8.6/conf/provision/service.d/postfix.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +# Installation +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + apt-install postfix + ;; + + RedHat) + yum-install postfix + + # Fix mysql lib + if [[ ! -f /lib64/libmysqlclient.so.18 ]] && [[ -f /usr/lib64/mysql/libmysqlclient.so.18 ]]; then + ln -s /usr/lib64/mysql/libmysqlclient.so.18 /lib64/libmysqlclient.so.18 + fi + ;; + + Alpine) + apk-install postfix + ;; +esac + +# Configuration +go-replace --mode=line \ + -s '^[\s]*mydestination[\s]*=' -r 'mydestination = ' \ + -s '^[\s]*message_size_limit[\s]*=' -r 'message_size_limit = 15240000' \ + -s '^[\s]*smtp_use_tls[\s]*=' -r 'smtp_use_tls = yes' \ + -s '^[\s]*smtp_tls_security_level[\s]*=' -r 'smtp_tls_security_level = may' \ + -s '^[\s]*myhostname[\s]*=' -r '# myhostname' \ + -- /etc/postfix/main.cf diff --git a/docker/php-official/8.6/conf/provision/service.d/ssh.sh b/docker/php-official/8.6/conf/provision/service.d/ssh.sh new file mode 100644 index 000000000..63d7a9f3a --- /dev/null +++ b/docker/php-official/8.6/conf/provision/service.d/ssh.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + apt-install openssh-server + ;; + + RedHat) + yum-install openssh-server + ;; + + Alpine) + apk-install openssh + ;; +esac diff --git a/docker/php-official/8.6/conf/provision/service.d/syslog.sh b/docker/php-official/8.6/conf/provision/service.d/syslog.sh new file mode 100644 index 000000000..675d0b061 --- /dev/null +++ b/docker/php-official/8.6/conf/provision/service.d/syslog.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +IMAGE_FAMILY=$(docker-image-info family) + +# Installation +case "$IMAGE_FAMILY" in + Debian|Ubuntu) + apt-install syslog-ng syslog-ng-core + ;; + + RedHat) + yum-install syslog-ng + + # remove logrotate (not needed for docker) + rm -f "/etc/cron.daily/logrotate" + ;; + + Alpine) + apk-install syslog-ng + ;; +esac + +## Configuration +SYSLOG_NG_VERSION=$(syslog-ng --version | grep -E -e '^Installer-Version:[ ]+[0-9]+\.[0-9]+' | head -n 1 | awk '{print $2}' | cut -f 1,2 -d .) + +# Disable caps inside container +if [[ -f /etc/default/syslog-ng ]]; then + go-replace --mode=lineinfile \ + -s "SYSLOGNG_OPTS" -r "SYSLOGNG_OPTS = --no-caps" \ + -- /etc/default/syslog-ng +fi + +# Symlink configuration +ln -s -f /opt/docker/etc/syslog-ng/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf + +go-replace --mode=lineinfile \ + -s "@version" -r "@version: ${SYSLOG_NG_VERSION}" \ + -- /etc/syslog-ng/syslog-ng.conf + +# Ensure /var/lib/syslog-ng exists +mkdir -p /var/lib/syslog-ng diff --git a/docker/php/8.6 b/docker/php/8.6 new file mode 120000 index 000000000..ac56fa764 --- /dev/null +++ b/docker/php/8.6 @@ -0,0 +1 @@ +../php-official/8.6 \ No newline at end of file diff --git a/docker/php/8.6-alpine b/docker/php/8.6-alpine new file mode 120000 index 000000000..d35b65247 --- /dev/null +++ b/docker/php/8.6-alpine @@ -0,0 +1 @@ +../php-official/8.6-alpine \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 5a1a3cde1..20496a3bd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -49,7 +49,7 @@ flowchart LR base --> baseapp["webdevops/base-app"] base --> nginx["webdevops/nginx"] base --> apache["webdevops/apache"] - officialphp["php:VERSION-fpm-bookworm / php:VERSION-fpm-alpine"] --> php["webdevops/php"] + officialphp["php:VERSION-fpm-bookworm / php:8.6-rc-fpm-trixie / php:VERSION-fpm-alpine"] --> php["webdevops/php"] php --> phpdev["webdevops/php-dev"] php --> phpnginx["webdevops/php-nginx"] php --> phpapache["webdevops/php-apache"] diff --git a/docs/assets/readme-banner-dark.svg b/docs/assets/readme-banner-dark.svg index 43c6fdd59..7495e76f4 100644 --- a/docs/assets/readme-banner-dark.svg +++ b/docs/assets/readme-banner-dark.svg @@ -1,6 +1,6 @@ webdevops image tags explained -Image tag anatomy using webdevops/php-nginx-dev:8.5-alpine as the example. Web server: php (PHP-FPM), php-apache (+ Apache) or php-nginx (+ Nginx). Variant: no suffix for production, -dev for development. PHP version: 8.2, 8.3, 8.4 or 8.5. Base OS: no suffix for Debian bookworm, -alpine for Alpine. Extends the official php images. linux/amd64 + linux/arm64. Rebuilt nightly. +Image tag anatomy using webdevops/php-nginx-dev:8.6-alpine as the example. Web server: php (PHP-FPM), php-apache (+ Apache) or php-nginx (+ Nginx). Variant: no suffix for production, -dev for development. PHP version: 8.2, 8.3, 8.4, 8.5 or 8.6. Base OS: no suffix for Debian (bookworm: 8.2–8.5; trixie: 8.6), -alpine for Alpine. Extends the official php images. linux/amd64 + linux/arm64. Rebuilt nightly. @@ -9,7 +9,7 @@ - + @@ -49,8 +49,10 @@ - - + + + + @@ -58,10 +60,12 @@ - - - - + + + + + + diff --git a/docs/assets/readme-banner-light.svg b/docs/assets/readme-banner-light.svg index 9a4164d54..a2f210c31 100644 --- a/docs/assets/readme-banner-light.svg +++ b/docs/assets/readme-banner-light.svg @@ -1,6 +1,6 @@ webdevops image tags explained -Image tag anatomy using webdevops/php-nginx-dev:8.5-alpine as the example. Web server: php (PHP-FPM), php-apache (+ Apache) or php-nginx (+ Nginx). Variant: no suffix for production, -dev for development. PHP version: 8.2, 8.3, 8.4 or 8.5. Base OS: no suffix for Debian bookworm, -alpine for Alpine. Extends the official php images. linux/amd64 + linux/arm64. Rebuilt nightly. +Image tag anatomy using webdevops/php-nginx-dev:8.6-alpine as the example. Web server: php (PHP-FPM), php-apache (+ Apache) or php-nginx (+ Nginx). Variant: no suffix for production, -dev for development. PHP version: 8.2, 8.3, 8.4, 8.5 or 8.6. Base OS: no suffix for Debian (bookworm: 8.2–8.5; trixie: 8.6), -alpine for Alpine. Extends the official php images. linux/amd64 + linux/arm64. Rebuilt nightly. @@ -9,7 +9,7 @@ - + @@ -49,8 +49,10 @@ - - + + + + @@ -58,10 +60,12 @@ - - - - + + + + + + diff --git a/docs/images/php-apache.md b/docs/images/php-apache.md index 0a4063f7f..224ac0e1a 100644 --- a/docs/images/php-apache.md +++ b/docs/images/php-apache.md @@ -4,7 +4,7 @@ ## Tags -`8.2`, `8.3`, `8.4`, `8.5` (Debian 12) and `8.2-alpine`, `8.3-alpine`, `8.4-alpine`, `8.5-alpine`, for both `php-apache` and `php-apache-dev`. +`8.2`, `8.3`, `8.4`, `8.5` (Debian 12), `8.6` (Debian 13) and `8.2-alpine`, `8.3-alpine`, `8.4-alpine`, `8.5-alpine`, `8.6-alpine`, for both `php-apache` and `php-apache-dev`. The `8.6` tags are a preview, see [PHP 8.6](php.md#php-86-preview). ## Usage diff --git a/docs/images/php-nginx.md b/docs/images/php-nginx.md index ab754fd29..880bd3ff1 100644 --- a/docs/images/php-nginx.md +++ b/docs/images/php-nginx.md @@ -4,7 +4,7 @@ ## Tags -`8.2`, `8.3`, `8.4`, `8.5` (Debian 12) and `8.2-alpine`, `8.3-alpine`, `8.4-alpine`, `8.5-alpine`, for both `php-nginx` and `php-nginx-dev`. +`8.2`, `8.3`, `8.4`, `8.5` (Debian 12), `8.6` (Debian 13) and `8.2-alpine`, `8.3-alpine`, `8.4-alpine`, `8.5-alpine`, `8.6-alpine`, for both `php-nginx` and `php-nginx-dev`. The `8.6` tags are a preview, see [PHP 8.6](php.md#php-86-preview). ## Usage diff --git a/docs/images/php.md b/docs/images/php.md index 044fb312e..cab11f0b3 100644 --- a/docs/images/php.md +++ b/docs/images/php.md @@ -9,9 +9,11 @@ PHP-FPM on top of the official PHP image, with the webdevops entrypoint, `superv | Tags | Based on | | --- | --- | | `8.2`, `8.3`, `8.4`, `8.5` | `php:-fpm-bookworm` (Debian 12) | +| `8.6` (preview) | `php:8.6-rc-fpm-trixie` (Debian 13, PHP 8.6 release candidate) | | `8.2-alpine`, `8.3-alpine`, `8.4-alpine`, `8.5-alpine` | `php:-fpm-alpine` | +| `8.6-alpine` (preview) | `php:8.6-rc-fpm-alpine` (PHP 8.6 release candidate) | -Both `webdevops/php` and `webdevops/php-dev` use these tags. For the differences between the Debian and the Alpine tags, see [Debian or Alpine](#debian-or-alpine). +Both `webdevops/php` and `webdevops/php-dev` use these tags. For the differences between the Debian and the Alpine tags, see [Debian or Alpine](#debian-or-alpine); for what is different in PHP 8.6, see [PHP 8.6](#php-86-preview). Always use one of these tags: an image without a tag (`latest`) and the `alpine` tag are old builds from 2019 and 2020, see [Known issues](../known-issues.md#latest-and-alpine-tags-of-the-php-images). @@ -56,7 +58,7 @@ Applications that read the upload progress from the session, using a form field All tags contain these extensions: -`amqp`, `apcu`, `bcmath`, `bz2`, `calendar`, `ctype`, `curl`, `date`, `dom`, `excimer`, `exif`, `ffi`, `fileinfo`, `filter`, `ftp`, `gd`, `gettext`, `gmp`, `hash`, `iconv`, `imagick`, `intl`, `json`, `ldap`, `libxml`, `mbstring`, `memcached`, `mongodb`, `mysqli`, `mysqlnd`, `openssl`, `opentelemetry`, `pcntl`, `pcre`, `pdo`, `pdo_mysql`, `pdo_pgsql`, `pdo_sqlite`, `pgsql`, `phar`, `posix`, `protobuf`, `random`, `readline`, `redis`, `reflection`, `session`, `shmop`, `simplexml`, `soap`, `sockets`, `sodium`, `spl`, `sqlite3`, `standard`, `sysvmsg`, `sysvsem`, `sysvshm`, `tokenizer`, `vips`, `xml`, `xmlreader`, `xmlrpc`, `xmlwriter`, `xsl`, `yaml`, `Zend OPcache`, `zip`, `zlib` +`amqp`, `apcu`, `bcmath`, `bz2`, `calendar`, `ctype`, `curl`, `date`, `dom`, `excimer`, `exif`, `ffi`, `fileinfo`, `filter`, `ftp`, `gd`, `gettext`, `gmp`, `hash`, `iconv`, `imagick`, `intl`, `json`, `ldap`, `libxml`, `mbstring`, `memcached`, `mongodb`, `mysqli`, `mysqlnd`, `openssl`, `opentelemetry`, `pcntl`, `pcre`, `pdo`, `pdo_mysql`, `pdo_pgsql`, `pdo_sqlite`, `pgsql`, `phar`, `posix`, `protobuf`, `random`, `readline`, `redis`, `reflection`, `session`, `shmop`, `simplexml`, `soap`, `sockets`, `sodium`, `spl`, `sqlite3`, `standard`, `sysvmsg`, `sysvsem`, `sysvshm`, `tokenizer`, `xml`, `xmlreader`, `xmlwriter`, `xsl`, `yaml`, `Zend OPcache`, `zip`, `zlib` Differences between tags: @@ -64,7 +66,8 @@ Differences between tags: | --- | --- | | `imap` | `8.2`, `8.3`, `8.2-alpine`, `8.3-alpine` | | ionCube Loader | Debian-based tags (`8.2` to `8.5`) | -| `lexbor`, `uri` | `8.5`, `8.5-alpine` | +| `lexbor`, `uri` | `8.5`, `8.6`, `8.5-alpine`, `8.6-alpine` | +| `vips`, `xmlrpc` | `8.2` to `8.5`, `8.2-alpine` to `8.5-alpine`; not in PHP 8.6, see [PHP 8.6](#php-86-preview) | Disable extensions you do not need with `PHP_DISMOD`, for example `PHP_DISMOD: redis,apcu`. @@ -113,9 +116,9 @@ Every PHP version comes as a Debian tag (`8.5`) and an Alpine tag (`8.5-alpine`) | Topic | Debian | Alpine | | --- | --- | --- | -| [Base image](#tags) | `php:-fpm-bookworm` (Debian 12) | `php:-fpm-alpine` | +| [Base image](#tags) | `php:-fpm-bookworm` (Debian 12); PHP 8.6: `php:8.6-rc-fpm-trixie` (Debian 13) | `php:-fpm-alpine` | | [Download size](https://hub.docker.com/r/webdevops/php/tags) of `webdevops/php:8.5` | about 430 MB | about 170 MB | -| [ionCube Loader](#php-extensions) | included | not included | +| [ionCube Loader](#php-extensions) | included up to PHP 8.5 | not included | | [`imap` extension](#php-extensions) | `8.2` and `8.3` only | `8.2-alpine` and `8.3-alpine` only | | [Build tools for extensions](#installing-more-extensions) | included | installed by `docker-php-ext-install`; for PIE install `$PHPIZE_DEPS` | | [Locales](../customization.md#locales) | several hundred, for example `de_DE.utf8` | none | @@ -125,6 +128,28 @@ Every PHP version comes as a Debian tag (`8.5`) and an Alpine tag (`8.5-alpine`) | [Apache index files](../environment-variables.md#web-server) in `php-apache` | `index.html`, `index.cgi`, `index.pl`, `index.php`, `index.xhtml`, `index.htm` come before `WEB_DOCUMENT_INDEX` | `index.html` comes before `WEB_DOCUMENT_INDEX` | | [`mail()` without Postfix](#mail) | fails: there is no `sendmail` command | fails: BusyBox `sendmail` finds no mail server | +## PHP 8.6 (preview) + +The `8.6` and `8.6-alpine` tags are a preview. They are built from the PHP 8.6 release candidate (`php:8.6-rc-fpm-trixie`, `php:8.6-rc-fpm-alpine`) and switch to the final release once PHP 8.6.0 is out. Compared with PHP 8.5: + +- **Debian 13:** The Debian tag `8.6` is based on Debian 13 (trixie) instead of Debian 12, because GD in PHP 8.6 needs a newer libavif than Debian 12 provides. Package names differ between the two releases, for example `libzip5` instead of `libzip4`. +- **Thread safe (ZTS):** The official PHP 8.6 images, and therefore all `8.6` tags, are built thread safe. Extensions that you compile yourself with PIE or `docker-php-ext-install` are built to match. +- **No `pecl`:** The official PHP 8.6 images no longer contain `pecl` and `pear`. Install extensions with PIE, see [Installing more extensions](#installing-more-extensions). +- **No `vips` and `xmlrpc`:** Both extensions are abandoned upstream and do not build against PHP 8.6. + - Instead of `vips`, use [`jcupitt/vips`](https://github.com/libvips/php-vips) 2.x, which calls libvips through FFI. libvips and the `ffi` extension are part of the images. By default PHP allows FFI only on the command line and in preloaded scripts; to use it in PHP-FPM, set `php.ffi.enable: "true"`. + - Instead of `xmlrpc`, use a userland library such as [`phpxmlrpc/phpxmlrpc`](https://github.com/gggeek/phpxmlrpc). +- **No ionCube Loader:** The ionCube Loader for thread-safe PHP does not load in the official images, which are built without Zend signals. +- **Development images:** Xdebug is a 3.6 pre-release. The Debian `-dev` images do not contain Tideways, because the current Tideways extension crashes PHP 8.6 on startup. +- **Unreleased extension versions:** `apcu`, `excimer`, `memcached`, `redis` and `yaml` have no release that supports PHP 8.6 yet and are built from their development branches; `amqp` and `protobuf` are built with fixes that are not released yet. + +```yaml +services: + php: + image: webdevops/php:8.6 + environment: + php.ffi.enable: "true" +``` + ## Production Use the images without `-dev` in production. The `-dev` images load Xdebug and start Postfix and an SSH server, and `php-dev` sets the password `dev` for `root` and `application`. diff --git a/docs/known-issues.md b/docs/known-issues.md index 9b9eb7fbf..de37b7e5a 100644 --- a/docs/known-issues.md +++ b/docs/known-issues.md @@ -54,8 +54,8 @@ These options and tools are part of the images but do not work, or work only in ### `contrib` and `non-free` packages in the Debian PHP images -- **Effect:** Only the Debian component `main` is enabled. The image build tries to add `contrib` and `non-free`, but its `sed` command expects the one-line `sources.list` format, while Debian 12 lists its sources in `/etc/apt/sources.list.d/debian.sources`. Packages from `contrib` or `non-free`, for example `unrar` or `ttf-mscorefonts-installer`, cannot be installed. -- **Images:** `php-*` with the Debian tags `8.2` to `8.5`. +- **Effect:** Only the Debian component `main` is enabled. The image build tries to add `contrib` and `non-free`, but its `sed` command expects the one-line `sources.list` format, while Debian 12 and 13 list their sources in `/etc/apt/sources.list.d/debian.sources`. Packages from `contrib` or `non-free`, for example `unrar` or `ttf-mscorefonts-installer`, cannot be installed. +- **Images:** `php-*` with the Debian tags `8.2` to `8.6`. - **Instead:** Enable the components in your Dockerfile: ```dockerfile @@ -67,15 +67,9 @@ These options and tools are part of the images but do not work, or work only in ### Alpine 3.20 repository in the Alpine PHP images - **Effect:** `/etc/apk/repositories` also lists the community repository of Alpine 3.20 (`https://dl-4.alpinelinux.org/alpine/v3.20/community/`), although the images are based on a newer Alpine release, for example 3.24 in `8.5-alpine`. `apk` reads that index too, so a package that is missing from the current release can be installed from Alpine 3.20, built against older libraries. -- **Images:** `php-*` with the Alpine tags `8.2-alpine` to `8.5-alpine`. +- **Images:** `php-*` with the Alpine tags `8.2-alpine` to `8.6-alpine`. - **Instead:** Remove the line in your Dockerfile before you install packages: `RUN sed -i '/\/v3\.20\//d' /etc/apk/repositories`. -### Package sources in the Debian Nginx images - -- **Effect:** `/etc/apt/sources.list` holds only the nginx.org repository and ends without a line break. A line appended with `echo "deb ..." >> /etc/apt/sources.list` is joined to the last line: apt ignores the new repository and only prints warnings such as `component misspelt in sources.list`. The nginx.org key is stored in the deprecated global keyring `/etc/apt/trusted.gpg`, which apt trusts for every repository; `apt-get update` warns about it. -- **Images:** `php-nginx` and `php-nginx-dev` with the Debian tags `8.2` to `8.5`. -- **Instead:** Add your own repositories as a new file in `/etc/apt/sources.list.d/`, for example `echo "deb http://deb.debian.org/debian bookworm-backports main" > /etc/apt/sources.list.d/backports.list`. - ### Xdebug settings written into `php.ini` - **Effect:** When an `XDEBUG_*` variable is set, the development images append its setting to `/opt/docker/etc/php/php.ini`, your own file. A read-write mount gets one more line on every start of the container, also on the host; with a `:ro` mount the container exits at start. @@ -113,10 +107,10 @@ These options and tools are part of the images but do not work, or work only in - **Images:** `php-nginx-dev`, `php-apache-dev`. - **Instead:** Use `docker compose exec`. -### Composer 1 on PHP 8.4 and 8.5 +### Composer 1 on PHP 8.4 to 8.6 - **Effect:** With `COMPOSER_VERSION=1`, every Composer run prints deprecation notices. -- **Images:** `php-*` with PHP 8.4 and 8.5. +- **Images:** `php-*` with PHP 8.4, 8.5 and 8.6. - **Instead:** Use Composer 2, the default. ## Migration from older images diff --git a/provisioning/php/general/provision/bootstrap.d/30-setup-ioncube.sh b/provisioning/php/general/provision/bootstrap.d/30-setup-ioncube.sh index 59a2d4245..8d15159dc 100644 --- a/provisioning/php/general/provision/bootstrap.d/30-setup-ioncube.sh +++ b/provisioning/php/general/provision/bootstrap.d/30-setup-ioncube.sh @@ -5,6 +5,13 @@ if [ $IMAGE_FAMILY == "Alpine" ]; then return fi +# The official PHP images are thread safe (ZTS) since PHP 8.6 and are built without +# Zend signals, which the ionCube ZTS loader needs (undefined zend_signal_globals_offset) +if [[ "$(php -n -r 'echo PHP_ZTS;')" == "1" ]]; then + echo "Skipping ionCube installation: the ionCube loader does not support this thread-safe PHP build" + return +fi + echo "Installing ionCube loader" case "$(uname -m)" in diff --git a/template/Dockerfile/images/baseapp.twig b/template/Dockerfile/images/baseapp.twig index 6e47a3243..37fcc9053 100644 --- a/template/Dockerfile/images/baseapp.twig +++ b/template/Dockerfile/images/baseapp.twig @@ -21,7 +21,7 @@ unzip \ bzip2 \ moreutils \ - dnsutils \ + bind9-dnsutils \ openssh-client \ rsync \ git \ diff --git a/template/Dockerfile/images/nginx.twig b/template/Dockerfile/images/nginx.twig index 98401d5a2..d31b70d35 100644 --- a/template/Dockerfile/images/nginx.twig +++ b/template/Dockerfile/images/nginx.twig @@ -6,9 +6,10 @@ {% macro debian(role='') -%} # Install nginx - && printf "deb http://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx\n deb-src http://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx" \ - >> /etc/apt/sources.list \ - && curl -L https://nginx.org/keys/nginx_signing.key | apt-key add - \ + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://nginx.org/keys/nginx_signing.key -o /etc/apt/keyrings/nginx.asc \ + && printf "deb [signed-by=/etc/apt/keyrings/nginx.asc] https://nginx.org/packages/debian/ $(docker-image-info dist-codename) nginx\n" \ + > /etc/apt/sources.list.d/nginx.list \ && apt-install \ nginx {%- endmacro %} diff --git a/template/Dockerfile/images/php-extensions.twig b/template/Dockerfile/images/php-extensions.twig index 173eb917d..a29a4c247 100644 --- a/template/Dockerfile/images/php-extensions.twig +++ b/template/Dockerfile/images/php-extensions.twig @@ -1,14 +1,25 @@ {# Extensions that are not part of PHP, built from PIE packages or their sources #} -{% macro external() -%} +{% macro external(version='') -%} && cd / \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ --skip-enable-extension --make-parallel-jobs="$(nproc)" \ +{% if version == '8.6' %} + # TODO PHP 8.6: the PHP 8.6 fixes of these extensions are merged upstream but not + # released yet; build their development branches until a release supports PHP 8.6 + "apcu/apcu:dev-master" \ + "wikimedia/excimer:dev-master" \ + open-telemetry/ext-opentelemetry \ + "php-memcached/php-memcached:dev-master" \ + "pecl/yaml:dev-php7" \ + "phpredis/phpredis:dev-develop" \ +{% else %} apcu/apcu \ wikimedia/excimer \ open-telemetry/ext-opentelemetry \ php-memcached/php-memcached \ pecl/yaml \ phpredis/phpredis \ +{% endif %} mongodb/mongodb-extension \ && rm -rf /tmp/pie \ && PROTOBUF_RELEASE_URL="$(curl -fsSLI --proto '=https' --proto-redir '=https' --retry 3 -o /dev/null -w '%{url_effective}' https://github.com/protocolbuffers/protobuf/releases/latest)" \ @@ -19,9 +30,17 @@ && cd /tmp/protobuf/php/ext/google/protobuf \ && mkdir -p third_party \ && cp -R /tmp/protobuf/third_party/utf8_range third_party/ \ +{% if version == '8.6' %} + # TODO PHP 8.6: protobuf still calls the zval_dtor() alias removed in PHP 8.6 + # https://github.com/protocolbuffers/protobuf/issues/29723 + && grep -rl 'zval_dtor(' . | xargs -r sed -i 's/\([^_a-z]\)zval_dtor(/\1zval_ptr_dtor_nogc(/g' \ +{% endif %} && phpize && ./configure --enable-protobuf \ && make -j"$(nproc)" && make install \ - && cd / && rm -rf /tmp/protobuf /tmp/protobuf.tar.gz \ + && cd / && rm -rf /tmp/protobuf /tmp/protobuf.tar.gz +{%- if version != '8.6' %} \ + # Vips and XML-RPC are only built up to PHP 8.5: both are abandoned upstream and + # do not build against PHP 8.6. # Vips' GitHub tags lag behind PECL releases; use the upstream branch. && git clone --depth 1 https://github.com/libvips/php-vips-ext.git /tmp/vips \ && cd /tmp/vips \ @@ -33,4 +52,29 @@ && phpize && ./configure --with-xmlrpc \ && make -j"$(nproc)" && make install \ && cd / && rm -rf /tmp/xmlrpc +{%- endif %} +{%- endmacro %} + +{# Check out the php-amqp sources in /usr/src/php/ext/amqp #} +{% macro amqpCheckout(version='') -%} +{% if version == '8.6' -%} + # TODO PHP 8.6: php-amqp has no release supporting PHP 8.6 yet; build the + # unmerged upstream fix https://github.com/php-amqp/php-amqp/pull/638 (pinned commit) + && cd /usr/src/php/ext/amqp \ + && git fetch --depth 1 origin 58edfb5e51a49cd10174cdfb18c73a539892d53d \ + && git checkout -q FETCH_HEAD \ + && git submodule update --init +{%- else -%} + && cd /usr/src/php/ext/amqp && git submodule update --init +{%- endif %} +{%- endmacro %} + +{# PIE package of Xdebug #} +{% macro xdebug(version='') -%} +{# TODO PHP 8.6: no stable Xdebug supports PHP 8.6 yet (3.5.x requires php <8.6) #} +{%- if version == '8.6' -%} +"xdebug/xdebug:^3.6@alpha" +{%- else -%} +xdebug/xdebug +{%- endif -%} {%- endmacro %} diff --git a/template/Dockerfile/images/php.twig b/template/Dockerfile/images/php.twig index f8dce0ef6..4f95046ad 100644 --- a/template/Dockerfile/images/php.twig +++ b/template/Dockerfile/images/php.twig @@ -1,4 +1,4 @@ -{% macro official(role='', version='') -%} +{% macro official(role='', version='', distribution='') -%} {% import 'services.twig' as services -%} {% import 'images/php-extensions.twig' as extensions -%} # Install php environment @@ -16,26 +16,39 @@ pngnq \ pngquant \ # Libraries +{% if distribution == 'trixie' %} + libavif16 \ + libvips42t64 \ + libldap2 \ + libpng16-16t64 \ + libzip5 \ + libmemcached11t64 \ +{% else %} libavif15 \ libvips42 \ - librabbitmq4 \ libldap-2.5-0 \ + libpng16-16 \ + libzip4 \ + libmemcached11 \ +{% endif %} + librabbitmq4 \ libxslt1.1 \ libldap-common \ zlib1g \ libpq5 \ - libpng16-16 \ libmcrypt4 \ - libzip4 \ libyaml-0-2 \ + libonig5 \ {% if version == '8.2' or version == '8.3' %} libc-client2007e \ + libc-client-dev \ + libc-client2007e-dev \ {% endif %} # Dev and headers libavif-dev \ libjpeg62-turbo-dev \ libwebp-dev \ - libfreetype6-dev \ + libfreetype-dev \ libbz2-dev \ libicu-dev \ libldap2-dev \ @@ -48,8 +61,6 @@ libpng-dev \ libpq-dev \ libzip-dev \ - libc-client-dev \ - libc-client2007e-dev \ libkrb5-dev \ libvips-dev \ librabbitmq-dev \ @@ -57,6 +68,7 @@ libgmp-dev \ libyaml-dev \ libssl-dev \ + libonig-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ && unzip master.zip \ @@ -70,15 +82,15 @@ && PKG_CONFIG_PATH=/usr/local docker-php-ext-configure intl \ && docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \ && git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \ - && cd /usr/src/php/ext/amqp && git submodule update --init \ + {{ extensions.amqpCheckout(version) }} \ && git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \ && docker-php-ext-configure ldap \ {% if version == '8.2' or version == '8.3' %} && docker-php-ext-configure ftp --with-openssl-dir \ -{% elseif version == '8.4' or version == '8.5' %} +{% elseif version == '8.4' or version == '8.5' or version == '8.6' %} && docker-php-ext-configure ftp --with-ftp-ssl \ {% endif %} -{% if version != '8.4' and version != '8.5' %} +{% if version != '8.4' and version != '8.5' and version != '8.6' %} && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ {% endif %} && docker-php-ext-install -j"$(nproc)" \ @@ -95,7 +107,10 @@ gettext \ ldap \ mysqli \ -{% if version != '8.4' and version != '8.5' %} +{% if version == '8.6' %} + mbstring \ +{% endif %} +{% if version != '8.4' and version != '8.5' and version != '8.6' %} imap \ {% endif %} pcntl \ @@ -111,10 +126,10 @@ xsl \ zip \ gd \ -{% if version != '8.5' %} +{% if version != '8.5' and version != '8.6' %} opcache \ {% endif %} - {{ extensions.external() }} \ + {{ extensions.external(version) }} \ && echo extension=apcu.so > /usr/local/etc/php/conf.d/apcu.ini \ && echo extension=excimer.so > /usr/local/etc/php/conf.d/excimer.ini \ && echo extension=opentelemetry.so > /usr/local/etc/php/conf.d/opentelemetry.ini \ @@ -122,13 +137,17 @@ && echo extension=redis.so > /usr/local/etc/php/conf.d/redis.ini \ && echo extension=mongodb.so > /usr/local/etc/php/conf.d/mongodb.ini \ && echo extension=memcached.so > /usr/local/etc/php/conf.d/memcached.ini \ - && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ && echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \ +{% if version != '8.6' %} + && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ && echo extension=xmlrpc.so > /usr/local/etc/php/conf.d/xmlrpc.ini \ +{% endif %} # Uninstall dev and header packages && apt-get purge -y -f --force-yes \ +{% if version == '8.2' or version == '8.3' %} libc-client-dev \ libc-client2007e-dev \ +{% endif %} libkrb5-dev \ libbz2-dev \ libavif-dev \ @@ -149,6 +168,7 @@ libgmp-dev \ libyaml-dev \ libssl-dev \ + libonig-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ @@ -183,6 +203,7 @@ libzip \ libmemcached \ yaml \ + oniguruma \ # Build dependencies linux-headers \ autoconf \ @@ -212,6 +233,7 @@ libzip-dev \ libmemcached-dev \ yaml-dev \ + oniguruma-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ && unzip master.zip \ @@ -228,14 +250,14 @@ && docker-php-ext-configure gd --with-avif --with-jpeg --with-freetype --with-webp \ && git clone --branch master --depth 1 https://github.com/Imagick/imagick.git /usr/src/php/ext/imagick \ && git clone --branch latest --depth 1 https://github.com/php-amqp/php-amqp.git /usr/src/php/ext/amqp \ - && cd /usr/src/php/ext/amqp && git submodule update --init \ + {{ extensions.amqpCheckout(version) }} \ && docker-php-ext-configure ldap \ {% if version == '8.2' or version == '8.3' %} && docker-php-ext-configure ftp --with-openssl-dir \ -{% elseif version == '8.4' or version == '8.5' %} +{% elseif version == '8.4' or version == '8.5' or version == '8.6' %} && docker-php-ext-configure ftp --with-ftp-ssl \ {% endif %} -{% if version != '8.4' and version != '8.5' %} +{% if version != '8.4' and version != '8.5' and version != '8.6' %} && PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ {% endif %} && docker-php-ext-install -j"$(nproc)" \ @@ -252,7 +274,10 @@ gettext \ ldap \ mysqli \ -{% if version != '8.4' and version != '8.5' %} +{% if version == '8.6' %} + mbstring \ +{% endif %} +{% if version != '8.4' and version != '8.5' and version != '8.6' %} imap \ {% endif %} pcntl \ @@ -268,22 +293,24 @@ xsl \ zip \ gd \ -{% if version != '8.5' %} +{% if version != '8.5' and version != '8.6' %} opcache \ {% endif %} - {{ extensions.external() }} \ + {{ extensions.external(version) }} \ && docker-php-ext-enable \ apcu \ excimer \ opentelemetry \ protobuf \ - vips \ yaml \ redis \ - xmlrpc \ imagick \ mongodb \ memcached \ +{% if version != '8.6' %} + vips \ + xmlrpc \ +{% endif %} # Uninstall dev and header packages && apk del -f --purge \ autoconf \ @@ -314,6 +341,7 @@ libzip-dev \ libmemcached-dev \ yaml-dev \ + oniguruma-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ @@ -323,14 +351,21 @@ {% macro officialDevelopment(role='', version='') -%} {% import 'services.twig' as services -%} +{% import 'images/php-extensions.twig' as extensions -%} # Install development environment && BLACKFIRE_INSTALL_METHOD=raw bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ && blackfire php:install \ - && echo 'deb https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ - && wget -qO - https://packages.tideways.com/key.gpg | apt-key add - \ +{% if version == '8.6' %} + # TODO PHP 8.6: Tideways is not installed yet, tideways-php 5.47.0 crashes + # PHP 8.6.0RC4 (ZTS) on startup +{% else %} + && install -d -m 0755 /etc/apt/keyrings \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 https://packages.tideways.com/key.gpg -o /etc/apt/keyrings/tideways.asc \ + && echo 'deb [signed-by=/etc/apt/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' | tee /etc/apt/sources.list.d/tideways.list \ && apt-install tideways-php tideways-daemon \ +{% endif %} && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ - --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ + --skip-enable-extension --make-parallel-jobs="$(nproc)" {{ extensions.xdebug(version) }} \ && rm -rf /tmp/pie \ && docker-php-ext-enable xdebug \ {{ services.phpDev() }} @@ -338,9 +373,20 @@ {% macro officialDevelopmentAlpine(role='', version='') -%} {% import 'services.twig' as services -%} +{% import 'images/php-extensions.twig' as extensions -%} # Install development environment && bash -c "$(curl -L https://installer.blackfire.io/installer.sh)" \ +{% if version == '8.6' %} + # TODO PHP 8.6: `blackfire php:install` installs the glibc probe on Alpine with ZTS; + # install the Alpine probe directly + && mkdir -p /tmp/blackfire \ + && curl -fsSL --proto '=https' --proto-redir '=https' --retry 3 "https://blackfire.io/api/v1/releases/probe/php/alpine/$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')/86-zts" | tar xz -C /tmp/blackfire \ + && mv /tmp/blackfire/blackfire-*.so "$(php -r 'echo ini_get("extension_dir");')/blackfire.so" \ + && printf '[blackfire]\nextension=blackfire.so\n' > /usr/local/etc/php/conf.d/99-blackfire.ini \ + && rm -rf /tmp/blackfire \ +{% else %} && blackfire php:install \ +{% endif %} && apk-install \ linux-headers \ make \ @@ -349,7 +395,7 @@ libtool \ pkgconf \ && PIE_WORKING_DIRECTORY=/tmp/pie pie install --no-interaction --no-cache \ - --skip-enable-extension --make-parallel-jobs="$(nproc)" xdebug/xdebug \ + --skip-enable-extension --make-parallel-jobs="$(nproc)" {{ extensions.xdebug(version) }} \ && rm -rf /tmp/pie \ && apk del -f --purge \ autoconf \ diff --git a/tests/serverspec/spec/shared/php/modules.rb b/tests/serverspec/spec/shared/php/modules.rb index b9311e20b..9dc27bdc5 100644 --- a/tests/serverspec/spec/shared/php/modules.rb +++ b/tests/serverspec/spec/shared/php/modules.rb @@ -59,10 +59,10 @@ its(:stdout) { should contain('sysvsem') } its(:stdout) { should contain('sysvshm') } its(:stdout) { should contain('tokenizer') } - its(:stdout) { should contain('vips') } + its(:stdout) { should contain('vips') } if $testConfiguration[:phpVips] its(:stdout) { should contain('xml') } its(:stdout) { should contain('xmlreader') } - its(:stdout) { should contain('xmlrpc') } + its(:stdout) { should contain('xmlrpc') } if $testConfiguration[:phpXmlrpc] its(:stdout) { should contain('xmlwriter') } its(:stdout) { should contain('xsl') } its(:stdout) { should contain('yaml') } @@ -190,10 +190,10 @@ its(:stdout) { should contain('sysvsem') } its(:stdout) { should contain('sysvshm') } its(:stdout) { should contain('tokenizer') } - its(:stdout) { should contain('vips') } + its(:stdout) { should contain('vips') } if $testConfiguration[:phpVips] its(:stdout) { should contain('xml') } its(:stdout) { should contain('xmlreader') } - its(:stdout) { should contain('xmlrpc') } + its(:stdout) { should contain('xmlrpc') } if $testConfiguration[:phpXmlrpc] its(:stdout) { should contain('xmlwriter') } its(:stdout) { should contain('xsl') } its(:stdout) { should contain('yaml') } diff --git a/tests/serverspec/spec/shared/php/version.rb b/tests/serverspec/spec/shared/php/version.rb index 5a08461ce..148a8b75d 100644 --- a/tests/serverspec/spec/shared/php/version.rb +++ b/tests/serverspec/spec/shared/php/version.rb @@ -8,7 +8,14 @@ '8.3' => '8.3.36', '8.4' => '8.4.27', '8.5' => '8.5.12', + # TODO PHP 8.6: raise to the first stable 8.6 release once the image uses php:8.6-fpm-* + '8.6' => '8.6.0RC4', }.fetch(php_minor) + # TODO PHP 8.6: release candidates are only accepted until PHP 8.6.0 is GA + allow_release_candidate = php_minor == '8.6' + version_pattern = allow_release_candidate ? + /\A#{Regexp.escape(php_minor)}\.[0-9]+(RC[0-9]+)?\z/ : + /\A#{Regexp.escape(php_minor)}\.[0-9]+\z/ describe command('php -v') do its(:stdout) { should match %r!PHP #{Regexp.escape(php_minor)}\.[0-9]+(RC[0-9]|beta[0-9])?(-[^\(]*)? \(cli\)! } @@ -17,9 +24,9 @@ end describe command(%q!php -r 'echo PHP_VERSION;'!) do - it "runs stable PHP #{minimum_version} or newer within #{php_minor}" do + it "runs PHP #{minimum_version} or newer within #{php_minor}" do version = subject.stdout.strip - expect(version).to match(/\A#{Regexp.escape(php_minor)}\.[0-9]+\z/) + expect(version).to match(version_pattern) expect(Gem::Version.new(version)).to be >= Gem::Version.new(minimum_version) end diff --git a/tests/serverspec/spec/spec_config.rb b/tests/serverspec/spec/spec_config.rb index bab5f3a8e..5de47e967 100644 --- a/tests/serverspec/spec/spec_config.rb +++ b/tests/serverspec/spec/spec_config.rb @@ -31,6 +31,9 @@ $testConfiguration[:phpBlackfire] = false $testConfiguration[:phpOfficialImage] = false $testConfiguration[:phpImap] = !!(ENV['DOCKER_TAG'] =~ /^8\.[123](-|$)/) +# vips and xmlrpc are abandoned upstream and only built up to PHP 8.5 +$testConfiguration[:phpVips] = !!(ENV.fetch('DOCKER_TAG', '') =~ /^8\.[2-5](-|$)/) +$testConfiguration[:phpXmlrpc] = !!(ENV.fetch('DOCKER_TAG', '') =~ /^8\.[2-5](-|$)/) if ENV['PHP_OFFICIAL'] and ENV['PHP_OFFICIAL'] == "1" $testConfiguration[:phpOfficialImage] = true diff --git a/tests/structure-test/php/test.yaml b/tests/structure-test/php/test.yaml index 581a5b0e2..adab1d39f 100644 --- a/tests/structure-test/php/test.yaml +++ b/tests/structure-test/php/test.yaml @@ -236,10 +236,8 @@ commandTests: - "sysvsem" - "sysvshm" - "tokenizer" - - "vips" - "xml" - "xmlreader" - - "xmlrpc" - "xmlwriter" - "xsl" - "yaml" @@ -250,3 +248,8 @@ commandTests: command: "/usr/local/bin/php-fpm" args: ["-m"] expectedOutput: *phpModules + # vips and xmlrpc are abandoned upstream and only built up to PHP 8.5 + - name: "vips and xmlrpc modules (PHP 8.5 and older)" + command: "php" + args: ["-r", "exit(PHP_VERSION_ID >= 80600 || (extension_loaded('vips') && extension_loaded('xmlrpc')) ? 0 : 1);"] + exitCode: 0