diff --git a/.github/workflows/reusable-phpunit-tests-v3.yml b/.github/workflows/reusable-phpunit-tests-v3.yml index 56e40e762cd27..fd21b3a9b48f5 100644 --- a/.github/workflows/reusable-phpunit-tests-v3.yml +++ b/.github/workflows/reusable-phpunit-tests-v3.yml @@ -171,7 +171,7 @@ jobs: - name: WordPress Docker container debug information run: | - docker compose run --rm mysql ${{ env.LOCAL_DB_TYPE }} --version + docker compose run --rm mysql ${{ env.LOCAL_DB_TYPE == 'mariadb' && contains( fromJSON('["5.5", "10.0", "10.1", "10.2", "10.3"]'), env.LOCAL_DB_VERSION ) && 'mysql' || env.LOCAL_DB_TYPE }} --version docker compose run --rm php php --version docker compose run --rm php php -m docker compose run --rm php php -i diff --git a/README.md b/README.md index adb4fc946d9a8..fc8c00f6821af 100644 --- a/README.md +++ b/README.md @@ -139,11 +139,14 @@ The development environment can be reset. This will destroy the database and att npm run env:reset ``` -### Apple Silicon machines and old MySQL versions +### Apple Silicon machines and old MySQL/MariaDB versions -The MySQL Docker images do not support Apple Silicon processors (M1, M2, etc.) for MySQL versions 5.7 and earlier. +Older MySQL and MariaDB Docker images do not support Apple Silicon processors (M1, M2, etc.). This is true for: -When using MySQL <= 5.7 on an Apple Silicon machine, you must create a `docker-compose.override.yml` file with the following contents: +- MySQL versions 5.7 and earlier +- MariaDB 5.5 + +When using these versions on an Apple Silicon machine, you must create a `docker-compose.override.yml` file with the following contents: ``` services: diff --git a/docker-compose.yml b/docker-compose.yml index 8b90b678a00a2..a95735fdd35a0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -82,7 +82,7 @@ services: command: ${LOCAL_DB_AUTH_OPTION-} healthcheck: - test: [ "CMD-SHELL", "if [ \"$LOCAL_DB_TYPE\" = \"mariadb\" ]; then mariadb-admin ping -h localhost; else mysqladmin ping -h localhost; fi" ] + test: [ "CMD-SHELL", "if [ \"$LOCAL_DB_TYPE\" = \"mariadb\" ]; then case \"$LOCAL_DB_VERSION\" in 5.5|10.0|10.1|10.2|10.3) mysqladmin ping -h localhost || exit $?;; *) mariadb-admin ping -h localhost || exit $?;; esac; else mysqladmin ping -h localhost || exit $?; fi" ] timeout: 5s interval: 5s retries: 10