Skip to content

Commit ed34930

Browse files
schlesseraclaude
andcommitted
Give the Docker workers the SQLite and MariaDB features of the runners
The SQLite built for the images of PHP 8.0 and older lacked options Debian enables, among them the dbstat table that `wp db size` reads, which made it hang. Build it with the same options as Debian. The MariaDB client of Debian 10 cannot log in to MySQL 8 with every authentication method the server offers for unknown users, so the "Access denied" that db-command expects turned into other errors. Install a newer client from MariaDB in that image, and the client library with the authentication plugins in all of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5fd427b commit ed34930

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎utils/docker/Dockerfile‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@
33
ARG PHP_VERSION=8.3
44
FROM php:${PHP_VERSION}-cli
55

6+
# The MariaDB client of Debian 10 cannot log in to MySQL 8 with every authentication method it
7+
# offers for unknown users, so the image of PHP 7.2 gets a newer one from MariaDB.
8+
RUN . /etc/os-release \
9+
&& if [ "${VERSION_CODENAME}" = buster ]; then \
10+
curl -fsSL -o /etc/apt/trusted.gpg.d/mariadb.asc https://mariadb.org/mariadb_release_signing_key.pgp \
11+
&& echo 'deb https://archive.mariadb.org/mariadb-10.6.27/repo/debian buster main' > /etc/apt/sources.list.d/mariadb.list; \
12+
fi
13+
614
# Images of older PHP versions are based on Debian releases whose packages have moved to the archive.
715
RUN install_packages() { \
816
apt-get update && apt-get install -y --no-install-recommends \
9-
curl git jq less mariadb-client procps sqlite3 subversion unzip vim-tiny zip \
17+
curl git jq less libmariadb3 mariadb-client procps sqlite3 subversion unzip vim-tiny zip \
1018
libfreetype6-dev libjpeg-dev libpng-dev libzip-dev; \
1119
} \
1220
&& ( install_packages || { \
@@ -32,7 +40,7 @@ RUN if dpkg --compare-versions "$(dpkg-query -W -f '${Version}' libsqlite3-0)" l
3240
&& [ "$(openssl dgst -sha3-256 -r sqlite.tar.gz | cut -d' ' -f1)" = "${SQLITE_SHA3_256}" ] \
3341
&& tar xzf sqlite.tar.gz \
3442
&& cd "sqlite-autoconf-${SQLITE_VERSION}" \
35-
&& CFLAGS="-O2 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_SECURE_DELETE" \
43+
&& CFLAGS="-O2 -DSQLITE_ALLOW_ROWID_IN_VIEW -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS3_TOKENIZER -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_LOAD_EXTENSION -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_SCHEMA_RETRY=25 -DSQLITE_SECURE_DELETE -DSQLITE_SOUNDEX -DSQLITE_USE_URI=1" \
3644
./configure --prefix=/usr/local --disable-static > /dev/null \
3745
&& make -j"$(nproc)" > /dev/null \
3846
&& make install > /dev/null \

0 commit comments

Comments
 (0)