Add support for Wolfi-based images#1287
Draft
toabctl wants to merge 1 commit into
Draft
Conversation
Wolfi (https://wolfi.dev) is an apk-based, rolling-release distribution maintained by Chainguard. Its package names mostly follow alpine's upstream-source naming, with a handful of well-known divergences this patch handles explicitly. Strategy: - Where alpine and wolfi share package names (~67 of the existing EXT@alpine entries), use POSIX `|` alternation: EXT@alpine | EXT@wolfi) <shared body> ;; - Where wolfi uses a different package name (e.g. enchant→enchant2, imagemagick→imagemagick-7, postgresql-libs→libpq-17, libsasl→ cyrus-sasl-libs, vips→libvips), emit a separate EXT@wolfi case with the renamed packages. - For deps that are alpine-musl-only (libexecinfo, libintl, bsd-compat-headers) or only used on PHP <= 5.6 (libvpx), drop them from the wolfi twin — they're not needed on glibc-based wolfi. - For extensions whose deps simply aren't packaged in wolfi (cassandra, enchant<8.0, imap, luasandbox, pspell, recode, tidy), no wolfi twin is emitted; those extensions remain alpine-only. Top-level `case "$DISTRO" in alpine) ...` and `case "$DISTRO_VERSION" in alpine@*) ...` switches use alternation since their bodies don't reference per-extension package names. `setDistro()` is unchanged — wolfi sets `ID=wolfi` in /etc/os-release and the rest of the script's distro-keyed lookups now have wolfi patterns to match. README updated to list Wolfi alongside Debian and Alpine.
Owner
|
I won't accept this (but of course you can fork this project and do whatever you like: it's a MIT peoject) |
Author
@mlocati why not? anything I can fix to get this accepted? |
Owner
|
Because there's a ton of custom images out there, this script is already rather complex, and some tests may already take 1 hour. |
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
Add support for Wolfi — an apk-based, rolling-release distribution maintained by Chainguard whose container images live under
cgr.dev/.... Wolfi mostly follows alpine's upstream-source package naming, with a handful of well-known divergences this PR handles explicitly.Strategy
For each
EXT@alpine)block, decide what its wolfi twin should look like:Shared package names → POSIX
|alternation. When alpine and wolfi use the same package names for an extension's deps (~67 of the existing entries: gd, redis, intl, opcache, mbstring, pdo_mysql, …), collapse to:Different package names → separate
EXT@wolfi)block with renames. Wolfi has the same library under a different name for ~15 deps:enchant,enchant-devenchant2,enchant2-devgeos,geos-devgeos-3.14,geos-3.14-devimagemagick,imagemagick-devimagemagick-7,imagemagick-7-devjudy,judy-devlibjudy,libjudy-devlapackliblapacklibbz2libbz2-1libmemcached-libslibmemcachedlibsaslcyrus-sasl-libslz4-libsliblz4-1mavenmaven-3.9openjdk8openjdk-8-default-jdkpostgresql-dev,postgresql-libspostgresql-17-dev,libpq-17python3,python3-devpython-3.13,python-3.13-devvips,vips-devlibvips,libvips-devzstd-libslibzstd1alpine-musl-only deps → silently dropped from wolfi twin.
libexecinfo,libintl,bsd-compat-headersare needed only on alpine because of musl libc; glibc-based wolfi has equivalents built into libc.libvpx/libvpx-devare only used by gd's PHP <= 5.6 path which isn't supported on wolfi anyway.No wolfi equivalent → no twin emitted. A few libs simply aren't packaged in wolfi:
aspell-*,cassandra-cpp-driver,c-client,imap-dev,lua5.1-*,recode,tidyhtml. The corresponding extensions (pspell,cassandra,imap,luasandbox,recode,tidy) remain alpine-only — install-php-extensions will fail on wolfi for those, with the same "package not found" error pattern as any genuinely-missing dep.setDistro()is unchanged — wolfi setsID=wolfiin/etc/os-releaseand the rest of the script's distro-keyed lookups now have wolfi patterns.Top-level switches
case "$DISTRO" in alpine) ...(apk update, simulate, virtual phpize-deps cleanup) andcase "$DISTRO_VERSION" in alpine@*) ...(openssl variant,$PHPIZE_DEPS, icu-data) use plain alternation — their bodies don't reference per-extension package names.Testing
Manually verified end-to-end on a Wolfi-based PHP image:
install-php-extensions gd redisresolves the right deps via apk on Wolfi (using the renamed names where applicable), runs phpize/configure/make against ZTS PHP, produces/usr/lib/php/modules/{gd,redis}.sowithtsrm_get_ls_cacheandtsrm_mutex_*references (ZTS-compatible).extension=gdandextension=redisregistered in$PHP_INI_DIR/conf.d/.imagecreatetruecolor/imagepngproduces a valid PNG, andnew Redis()instantiates correctly.CI integration is not included in this PR — happy to add a wolfi build matrix entry if you'd like, just want to flag it as a separate question since it'd require deciding which Wolfi base image to test against.
Out of scope
pspell,cassandra,imap,luasandbox,recode,tidy) remain alpine-only.Filed as a draft to invite feedback on the rename mappings and CI integration approach.