fix: MySQL readiness probe, dump bridge on legacy PHP, and PHP 7.2 image build#406
Merged
Conversation
…age build The MySQL readiness probe ran mysqladmin ping with no host, so it fell back to the Unix socket at /var/run/mysqld/mysqld.sock; images that keep the socket elsewhere failed the probe for the full 30 second timeout and printed a could not start mysql warning before every PHP command even though the server was healthy. The probe now forces IPv4 loopback TCP, which is independent of the image's socket path and stays correct inside the container on macOS and IPv6-only host networks. The mysql service-migration probe, dump, and restore commands force TCP the same way. The dump() and dd() bridge that lerd installs as an auto_prepend_file used match, mixed and never type declarations, str_contains, str_ends_with, and array_key_first, none of which parse on PHP 7.4 and several not on 8.0, so those versions aborted with a fatal parse error before running any code and broke every CLI command and web request. The bridge is rewritten in syntax valid on every PHP version lerd builds, from 7.2 through 8.5, with identical behaviour on current PHP. Building a PHP 7.2 image failed because its Alpine 3.12 base predates the icu-data-full package, gd's post-7.4 configure flags, current phpredis and xdebug, the bat package, and a transitive libgomp that ImageMagick needs. icu-data-full now installs tolerantly, gd's configure branches on PHP_VERSION_ID, xdebug and phpredis are pinned to the last releases supporting the older PHP line, bat installs tolerantly, and libgomp is added explicitly.
# Conflicts: # docs/changelog.md # internal/podman/quadlets/lerd-php-fpm.Containerfile # internal/version/version.go
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.
Forward-port of the v1.21.2 hotfix to main. v1.21.2 was cut and released from the v1.21.1 tag; this merges chore/release-v1.21.2 into main so the 1.22 line carries the same three fixes plus the [1.21.2] changelog entry. version.go stays at 1.22.0-beta.1 since no new release is cut here, and the [1.21.2] changelog section is slotted under [1.22.0-beta.1].
The MySQL readiness probe ran mysqladmin with no host and fell back to the Unix socket, so on images whose socket is not at /var/run/mysqld/mysqld.sock it failed for the full 30 second timeout and warned could not start mysql before every PHP command even though the server was healthy. It now forces IPv4 loopback TCP, which is independent of the image's socket path and stays correct inside the container on macOS and IPv6-only host networks. The mysql service-migration probe, dump, and restore commands force TCP the same way.
The dump() and dd() bridge that lerd installs as an auto_prepend_file used match, mixed and never type declarations, str_contains, str_ends_with, and array_key_first, none of which parse on PHP 7.4 and several not on 8.0, so those versions aborted with a fatal parse error before running any code. The bridge is rewritten in syntax valid from PHP 7.2 through 8.5, with identical behaviour on current PHP.
Building a PHP 7.2 image failed because its Alpine 3.12 base predates the icu-data-full package, gd's post-7.4 configure flags, current phpredis and xdebug, the bat package, and a transitive libgomp that ImageMagick needs. icu-data-full now installs tolerantly, gd's configure branches on PHP_VERSION_ID, xdebug and phpredis are pinned to the last releases supporting the older PHP line, bat installs tolerantly, and libgomp is added explicitly.
This adds on #405, which cherry-picked only the fixes; this branch-merge brings the changelog entry too.