Problems getting quickstart WordPress and MariaDB working on M1 Mac

Hi all, I have a problem that I think is specific to Macs running Apple Silicon (M1 chips).

I want to set up a development WordPress instance to experiment with. So I started with the sample provided in the docker documentation - Quickstart: Compose and WordPress | Docker Documentation

This works when I run it on an Ubuntu server with Docker installed. But I’d like to have the experimental site running on my laptop. My laptop is an M1 MacBook Pro and when I use the sample docker-compose.yml it won’t start because there isn’t a MySQL 5.7 image for arm64.

I know that MariaDB is a drop in replacement for MySQL and that 10.2 is supposed to be the equivalent for MySQL 5.7. So I changed this line in the provided docker-compose.yml;

  db:
    image: mysql:5.7

To use MariaDB instead;

  db:
    image: mysql:5.7

The compose stack will start without problems on my MacBook but when I try and access the site at http://localhost:8000 all I get is a banner saying " Error establishing a database connection"

So it looks like MariaDB isn’t quite compatible enough.

My question is has anyone got WordPress and MariaDB working on Docker on an Apple Silicon machine? Or can suggest a way to run MySQL 5.7 in a container on this machine?

Thanks in advance

After making some minor changes I reverted to the yaml file from the quickstart and left the containers running. I had, I think, been too quick to try and access WordPress and was getting a database error because the database hadn’t been created.

I left the containers to run for several minutes and was then able to access the WordPress site from http://localhost:8000

Hi, yes the first run of mysql/mariadb takes some times, as it creates the database and run scripts to import and create the user+grants, and then it restarts :slight_smile: