MySQL Docker Image for Mac ARM M1
Emmanuel Gautier / February 26, 2022
2 min read
For a few years now, Apple released new ARM-based SoC for Mac: Apple M1 and Apple M2 CPU. There are 64-bit ARMv8 processors specially designed for MacOS and iPadOS. Linux Kernel also brings supports this SoC since version 5.13.
Various software and Docker images are not compatible with the microarchitecture ARMv8 and the MySQL official Docker image is one of them. Let's see how using MySQL with Apple M1, Apple M2, and more globally ARMv8.
Use ARM64v8 Docker Image
In order to use a MySQL Docker image with ARMv8, you need to use the arm64v8/mysql
docker image instead of the official mysql/mysql-server
. More tags are available on the official Docker Hub ARM64v8 repository.
This solution should also work for other SoC using AMRv8 micro-architecture. Those kind of ARM-compatible docker images are also available for other technologies like PHP, Python, Mongo, ... etc.
Here is an additional example of docker-compose
file using the above image:
version: '3'
services:
db:
image: arm64v8/mysql:oracle
command: --default-authentication-plugin=mysql_native_password
restart: always
expose:
- 3306
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "true"
Build your own image
When a docker image is not available for an architecture, another option is basically to build the image on this architecture. This way, you can build your own image from the official Docker Github repository.
Consulting
If you're seeking solutions to a problem or need expert advice, I'm here to help! Don't hesitate to book a call with me for a consulting session. Let's discuss your situation and find the best solution together.
Related Posts
How to solve Docker compose error ".labels array items must be unique"?
This blog post provides a clear understanding and a solution for the docker compose error `array items must be unique`.
How to fix DNS Internal Resolution inside the Nginx docker container
Sometimes, errors with Docker and some containers can become cryptic when it is about networking. Today, it was Nginx that was not able to reach another container.
How to deal with Docker Hub rate limit on AWS
Since 2020, DockerHub has been limited to only 200 container image pull requests per six hours. This article will help you to deal with this limitation on AWS.
Featured Posts
Introducing new blog about OAuth, OpenID Connect, and IAM Solutions
I'm excited to announce the launch of a new blog named CerberAuth, where I'll be exploring the world of OAuth, OpenID Connect, and IAM solutions for modern security.
How to deal with Docker Hub rate limit on AWS
Since 2020, DockerHub has been limited to only 200 container image pull requests per six hours. This article will help you to deal with this limitation on AWS.
How to enable Python type checking in VSCode
Python now has support for type hints. In this article, we will see how to enable better IntelliSense and type checking analysis in VSCode.