This article was originally published on bmf-tech.com.
I recently upgraded to an M1 Mac and tried to run a MySQL container for my local development environment, but it didn't work.
Here's the error:
runtime: failed to create new OS thread (have 2 already; errno=22)
Since it was a Go error, I guessed it might be an architecture-related issue.
I checked Docker Hub for a version newer than 8.0.17 and found that the latest patch version 8.0.26 had been released.
It seems it was released just two days ago.
It looks like MySQL 8.0.26 includes support for M1, so it might work with this version.
cf. https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-26.html
macOS: It is now possible to build MySQL for macOS 11 on ARM (that is, for Apple M1 systems). (Bug #32386050, Bug #102259)
Specify --platform and set the image to 8.0.26.
FROM --platform=linux/amd64 mysql:8.0.26
ADD ./conf.d/my.cnf /etc/mysql/conf.d/my.cnf
CMD ["mysqld"]
This worked for now.
Top comments (0)