You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP apps (Drupal, Laravel, WordPress) need the MySQL/MariaDB CLI (mysql, mysqldump) in the container — not only pdo_mysql / mysqli. Drush (sql:cli, sql:dump), Artisan, and WP-CLI all shell out to those binaries.
The stock image does not include them. On Kubernetes we currently start as root and install at runtime:
apk add mysql-client
That adds startup latency, depends on package repos at every pod start, and breaks the unprivileged default.
👥 Problem evidence & reach
Anyone running Drush, Laravel dump/restore, or WP-CLI against MySQL hits this. Existing workarounds are custom Dockerfiles (default-mysql-client on Debian, mysql-client on Alpine) or CI apk add. Helm/K8s users who pull the Hub image directly cannot easily do that.
🏆 How to solve this problem
Any of these would work (prefer 1 or 2 if default size is a concern):
ENV opt-in (e.g. INSTALL_MYSQL_CLIENT=true): entrypoint installs the distro client once at start, then continues as www-data. Avoids a custom Dockerfile; still needs network/repos unless cached.
Separate tag with the client bundled, e.g. 8.4-fpm-nginx-mysql / 8.4-cli-mysql (or a -tools variant). Same unprivileged image, no runtime apk/apt.
Include in all tags if the size hit is acceptable.
Package names
Debian:default-mysql-client (mysql-client has no candidate on current Debian)
Alpine:mysql-client (pulls mariadb-client)
Estimated image size
Rough, from current distro packages (uncompressed in the image; compressed Hub layers are smaller):
Debiandefault-mysql-client → mariadb-client: ~15–40 MB installed (metapackage itself is tiny; the client is the cost)
A dedicated Alpine “mysql-client only” image is ~18 MB compressed; added to serversideup/php expect on the order of ~10–20 MB extra compressed per tag, more on Debian if the full client (not -core) is used.
🥰 Describe the "impact" on users?
Drush/Artisan/WP-CLI DB commands work without a custom Dockerfile or root postStart install. Users who do not need the CLI keep a small default image (ENV or extra tag). Unprivileged user stays the default for bundled tags.
💯 How do we validate the problem is solved?
On Debian and Alpine, as www-data, without a custom image (bundled tag or ENV enabled):
mysql --version and mysqldump --version succeed.
mysql -h … -e 'SELECT 1' and a mysqldump against a test DB work.
Optional: drush sql:dump or equivalent Artisan/WP-CLI command.
Default tags without ENV stay unchanged in size and still run unprivileged.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
👉 Describe the problem
PHP apps (Drupal, Laravel, WordPress) need the MySQL/MariaDB CLI (
mysql,mysqldump) in the container — not onlypdo_mysql/mysqli. Drush (sql:cli,sql:dump), Artisan, and WP-CLI all shell out to those binaries.The stock image does not include them. On Kubernetes we currently start as root and install at runtime:
That adds startup latency, depends on package repos at every pod start, and breaks the unprivileged default.
👥 Problem evidence & reach
Anyone running Drush, Laravel dump/restore, or WP-CLI against MySQL hits this. Existing workarounds are custom Dockerfiles (
default-mysql-clienton Debian,mysql-clienton Alpine) or CIapk add. Helm/K8s users who pull the Hub image directly cannot easily do that.🏆 How to solve this problem
Any of these would work (prefer 1 or 2 if default size is a concern):
INSTALL_MYSQL_CLIENT=true): entrypoint installs the distro client once at start, then continues aswww-data. Avoids a custom Dockerfile; still needs network/repos unless cached.8.4-fpm-nginx-mysql/8.4-cli-mysql(or a-toolsvariant). Same unprivileged image, no runtimeapk/apt.Package names
default-mysql-client(mysql-clienthas no candidate on current Debian)mysql-client(pullsmariadb-client)Estimated image size
Rough, from current distro packages (uncompressed in the image; compressed Hub layers are smaller):
mariadb-client: ~25–30 MB installed (~7 MB package download)default-mysql-client→mariadb-client: ~15–40 MB installed (metapackage itself is tiny; the client is the cost)A dedicated Alpine “mysql-client only” image is ~18 MB compressed; added to
serversideup/phpexpect on the order of ~10–20 MB extra compressed per tag, more on Debian if the full client (not-core) is used.🥰 Describe the "impact" on users?
Drush/Artisan/WP-CLI DB commands work without a custom Dockerfile or root
postStartinstall. Users who do not need the CLI keep a small default image (ENV or extra tag). Unprivileged user stays the default for bundled tags.💯 How do we validate the problem is solved?
On Debian and Alpine, as
www-data, without a custom image (bundled tag or ENV enabled):mysql --versionandmysqldump --versionsucceed.mysql -h … -e 'SELECT 1'and amysqldumpagainst a test DB work.drush sql:dumpor equivalent Artisan/WP-CLI command.All reactions