I’m running the latest build of the Docker Apple Silicon Preview. I created the tutorial container/images and it works fine. When I went to create a custom YAML file and run docker-compose I get the following error when pulling mysql:
ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries
Here is a snippet from my YAMl file:
version: '3'
services:
# Database
db:
image: mysql-server:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: pass
MYSQL_DATABASE: wp
MYSQL_USER: wp
MYSQL_PASSWORD: wp
networks:
- wpsite
I’ve tried :latest and :8 which result in the same error. It pulls phpmyadmin and wordpress fine.
22
Answers
Well, technically it will not solve your issue (running MySQL on ARM), but for the time being, you could add
platform
to your service like:Alternatively, consider using MariaDB, which should work as a drop-in replacement like e.g. this:
Both ways work for me on M1 with the Docker Preview
I had a similar issue, solved with this line in my dockerfile:
before
after
Oracle maintains a MySQL 8.0.23 docker image for arm64.
https://hub.docker.com/r/mysql/mysql-server
To use it in your docker-compose file
Please refer to the following link for known issues. In your Mac’s terminal run
and then in docker-compose have something along the lines of
For anyone struggling to make it work with a specific version, the following didn’t work for me:
but this did:
same problem for m1 mac just run this command
From this answer, I added this to my local
docker-compose.override.yml
can try start/run a container (for mac m1)
Please note that when using
--platform linux/x86_64
on arm64/v8 you may lose Linux Native AIO support.Check out the docker container logs:
Consider using mysql/mysql-server instead, as it has arm64/v8 support out of the box.
This Github repo allows to build a MySQL 5.7 aarch64 image.
Building it with the following command (naming it the same as the official mysql:5.7 image) it will be used by default by all your docker-compose configurations or Dockerfiles that specify mysql:5.7.
It means that you won’t have updates from the official MySQL Dockerhub repo anymore, but as a temporary drop-in replacement I find it useful.
Docker on its official documentation says:
(source here)
So what you should do to make your project work is to add
platform: linux/amd64
to your docker-compose.yml.It would look like:
As you can imagine probably the performance won’t be the same.
Attempts to run x86 containers on M1 machines under emulation can crash. Even when the containers do run correctly under emulation, they will be slower and use more memory than the native equivalent. From here https://docs.docker.com/desktop/mac/apple-silicon/#known-issues
This works for me in mac M1, specifying platform key inside service.
I’ve also encountered this issue on M1 Pro and to solve the most stable way for me was to disable buildkit in the Docker engine settings, meaning setting to false instead the default true. There is also an open issue here https://github.com/docker/for-mac/issues/5873
Look at this github post
Since "Oracle only supplies pre-compile Arm64" binaries, you have it there with
Image –> mysql:8.0-oracle
Change the platform in docker command
Param : –platform linux/x86_64
This is for anyone who is here for the same issue but with the ibmcom/db2
You can use the below command to pull the db2 image
Using this below image solved my problem.
In your
Dockerfile
for mysql if you have the followingFROM mysql:8.0.28
change it to
FROM --platform=linux/x86_64 mysql:8.0.28
because the Docker in Apple M1 is going to look for an ARM image, and MySQL doesn’t publish ARM images, so that’s why you are getting
with the
--platform
flag, even though we are in ARM processor we are telling docker that we want to use thex86_64
imageI have the M1 chip.
Today I found this works fine in the latest KSQL master branch. Here’s the commands
It magically brings up the Zookeeper, three instances of Kafka server, a Schema Registry and a CLI.
Reference:
KSQLDB Docker Guide
To resolve the issue, we need to pass the platform with value into your docker image/file.
Using docker-compose.yaml file:
Using Docker file:
Using docker pull command:
Using DOCKER_DEFAULT_PLATFORM parameter:
Some of other well known platforms are:
linux/amd64
,linux/arm64
etc.docker run --platform linux/amd64 --name mysql-5-7 -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 -d mysql:5.7