Make WordPress Core

Opened 3 years ago

Closed 2 years ago

#52591 closed defect (bug) (wontfix)

Update mysql image in WordPress Docker setup to work on arm architectures

Reported by: justinahinon's profile justinahinon Owned by: netweb's profile netweb
Milestone: Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch close
Focuses: Cc:

Description

When following the steps in https://github.com/WordPress/wordpress-develop/blob/master/README.md to set up a WordPress Core development environment, you'll run into an error at this step: npm run env:start when the script is pulling the mysql image.

ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries

This is due to mysql not supporting yet arm architectures (per https://github.com/docker-library/mysql/issues/318#issuecomment-339460074).

Change History (5)

This ticket was mentioned in PR #1029 on WordPress/wordpress-develop by JustinyAhin.


3 years ago
#1

  • Keywords has-patch added

This PR allows pulling MySQL image on arm architectures while

Fixes https://core.trac.wordpress.org/ticket/52591

#2 follow-up: @desrosj
3 years ago

  • Keywords close added
  • Version trunk deleted

I was working through this with @afragen over the weekend as well. It's likely that this will be fixed upstream, so I'm hesitant to make this temporary change.

For the time being, you can easily work around this with two approaches.

  1. Create a docker-compose-override.yml file and define the mysql container with the platform specified.
  2. Use mariadb instead of mysql. You can do this by changing the .env file LOCAL_DB_TYPE and LOCAL_DB_VERSION variables locally to mariadb and latest or by exporting those variables using command line before running npm run env:start.

I am writing a Build/Test Tools post for the Make Core blog detailing several tooling updates and I will include a small section detailing this and other small M1 issues that have been discovered.

Last edited 2 years ago by netweb (previous) (diff)

This ticket was mentioned in Slack in #core-test by desrosj. View the logs.


3 years ago

#4 @netweb
3 years ago

  • Owner set to netweb
  • Status changed from new to accepted

Happy to test this, will test on M1 & Intel

As far as I'm aware right now MySQL haven't published an ARM64 build of MySQL 5.x, only 8.x

#5 in reply to: ↑ 2 @netweb
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from accepted to closed

Replying to desrosj:

... It's likely that this will be fixed upstream, so I'm hesitant to make this temporary change.

For the time being, you can easily work around this with two approaches.

I agree, hard-coding platform: linux/x86_64 would break the other work-around, as MariaDB would then try to pull in the x86_64 version rather than the MAc M1 native linux/arm64 package, the other downside is that linux/x86_64 would be running through QEMU emulation and Rosetta 2, thus with degraded performance.

Another issues is that https://hub.docker.com/_/mysql is maintained by the Docker team, and not Oracle, the Docker team have yet to publish any linux/arm64 images on Docker Hub

The Docker Hub account https://hub.docker.com/r/mysql is a fork of the above by the Oracle team, and it does publish linux/arm64 images for MySQL v8

Going to close this ticket as the workarounds documented should be sufficient and has no further unintended consequences for those who are not using the ARM64 platform

Aside: Updating the docs in the .env file to document said workaround would be nice to see #goodfirstbug https://core.trac.wordpress.org/browser/trunk/.env

Note: See TracTickets for help on using tickets.