Repository navigation
Install extensions with PIE on PHP 8.3+ and add php-disable-module - #16
Merged
Merged
Conversation
- Replace pecl: with pie: in the 8.3-8.6 configs; 8.6 builds imagick, memcached and yaml from pinned commits with PIE - Ship pie and the pie-install helper in images with pie: in the config - Add php-disable-module (also --all-except and --list) to the images - Add PHP_DISABLE_MODULES and PHP_ENABLED_MODULES; deprecate DISABLEMODULE_<name> - install-sqlsvr: use PIE when available, skip the extension when it does not build, and detect aarch64 - Keep '#' inside words when stripping template comments
- php-disable-module also disables the modules that require a disabled one (e.g. dom also disables xmlreader and xsl) - Find a module by the extension line of its ini file, not the file name - A module already disabled is not an error, so it is safe to run again (fixes a container that failed on restart with PHP_ENABLED_MODULES) - Both PHP_DISABLE_MODULES and PHP_ENABLED_MODULES always show errors and stop the container; the deprecated DISABLEMODULE_<name> only warns - Check that PHP starts cleanly after disabling, in both modes - Clean up shellcheck warnings in php-disable-module and entrypoint.sh - Fix the docs saying which PHP versions use PIE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PIE instead of PECL (PHP 8.3+)
pie:instead ofpecl:. Older versions keeppecl:, since PIE needs PHP 8.1+ and those configs were not migrated.imagick,memcachedandyamlare built with PIE from pinned commits, because their latest releases do not compile on 8.6 yet.pie(1.5.2, checksum verified) and apie-installhelper. The helper adds the build tools, runspie install, and removes the tools again.install-sqlsvr.shuses PIE when it is available. It skips the PHP extension when it does not build, and now detectsaarch64.php-disable-module
php-disable-modulehelper in every image:php-disable-module <module>...disables the modules, plus the modules that require them (e.g.domalso disablesxmlreaderandxsl).--all-except <module>...keeps the given modules and the ones they require, and disables the rest.--listlists the modules that can be disabled.Runtime environment variables
PHP_DISABLE_MODULESandPHP_ENABLED_MODULES(comma or space separated).DISABLEMODULE_<name>still works but is deprecated: it prints a warning and never stops the container.Other
#inside a word, for PIE constraints such asvendor/pkg:dev-master#<commit>.entrypoint.shandphp-disable-modulepass shellcheck with no warnings.building.md,dockerfile.md,environment.md,security.md, and the imageindex.html.Testing
I compared the generated Dockerfiles with the ones from
master. The only change for versions without PIE is thephp-disable-modulecopy. In the 8.5 set, cli, fpm, fpm-apache, fpm-nginx and nginx are unchanged.I tested
php-disable-moduleandentrypoint.shby mounting them into the existing 8.5 and 8.6 images (cli, fpm, fpm-nginx, fpm-apache):--all-except;docker restart;For the web images I checked the loaded modules over HTTP.
Not tested yet: a full image build from this branch. The CI run on this PR builds the images; it does not push them.