Reputation: 6364
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.
Upvotes: 536
Views: 541957
Reputation: 1679
I faced the same issue on Mac M3 after updating to macOS Sequoia 15.3.1. Docker stated this message:
Unable to find image 'neo4j:4.3' locally
4.3: Pulling from library/neo4j
docker: no matching manifest for linux/arm64/v8 in the manifest list entries.
See 'docker run --help'.
So I inserted a --platform=linux/amd64
to the docker run
command:
docker run \
--publish=7474:7474 --publish=7687:7687 --platform=linux/amd64 \
neo4j:4.3
This ran on my machine and I was happy.
Upvotes: 0
Reputation: 201
I have a similar issue with the M1 chip. This is because some images don’t support the new Apple M1 Chip.
If you are getting this error "no matching manifest for Linux/arm64/v8 in the manifest list entries" on the Apple M1 Silicon chip using Docker Compose.
Add the platform: linux/amd64 in your docker-compose.yml
Modifying the yml file above:
version: '3'
services:
# Database
db:
image: mysql-server:5.7
platform: linux/amd64
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: pass
MYSQL_DATABASE: wp
MYSQL_USER: wp
MYSQL_PASSWORD: wp
networks:
- wpsite
Upvotes: 20
Reputation: 1874
I am the only one with Mac (M1 chip) in my team. All others have Windows, so if I want to be compatible with others in git I need to use a solution that isolates the part of the config relating to my machine.
To add more configurations but use a different file, create a new docker-compose file docker-compose.mac.yml
in the same directory as the normal one docker-compose.yml
. (Instead of the word mac can be used anything)
version: '2'
services:
mysql:
image: mysql:8.0.26
platform: linux/amd64
Then start it with this command:
docker-compose -f docker-compose.yml -f docker-compose.mac.yml up
It will copy everything from docker-compose.yml
file and paste it into docker-compose.mac.yml
file but without replacing.
In my opinion, it is super useful in a bigger teams with different computers.
Upvotes: 30
Reputation: 1068
You just need to specify the platform after specifying the image. Working on M2 processor
version: '3'
services:
# Database
db:
image: mysql-server:5.7
platform: linux/amd64 <--------- this line to add
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: pass
MYSQL_DATABASE: wp
MYSQL_USER: wp
MYSQL_PASSWORD: wp
networks:
- wpsite
Upvotes: 34
Reputation: 1222
docker run --platform linux/amd64 --name mysql-5-7 -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 -d mysql:5.7
Upvotes: 8
Reputation: 3066
To resolve the issue, we need to pass the platform with value into your docker image/file.
Using docker-compose.yaml file:
services:
db:
platform: linux/x86_64
image: mysql:5.7
...
Using Docker file:
FROM --platform=linux/x86_64 mysql:5.7
Using docker pull command:
docker pull --platform=linux/x86_64 mysql:5.7
Using DOCKER_DEFAULT_PLATFORM parameter:
export DOCKER_DEFAULT_PLATFORM=linux/x86_64
Some of other well known platforms are: linux/amd64
, linux/arm64
etc.
Upvotes: 8
Reputation: 606
Look at this github post
Since "Oracle only supplies pre-compile Arm64" binaries, you have it there with
Image --> mysql:8.0-oracle
docker run -d --name mysql-8 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=<your_password> mysql:8.0-oracle
Upvotes: 2
Reputation: 680
I have the M1 chip.
Today I found this works fine in the latest KSQL master branch. Here's the commands
git clone https://github.com/confluentinc/ksql.git
cd ksql
docker-compose up -d
It magically brings up the Zookeeper, three instances of Kafka server, a Schema Registry and a CLI.
Reference: KSQLDB Docker Guide
Upvotes: -1
Reputation: 11491
In your Dockerfile
for mysql if you have the following
FROM 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
failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest
with the --platform
flag, even though we are in ARM processor we are telling docker that we want to use the x86_64
image
Upvotes: 10
Reputation: 685
Using this below image solved my problem.
mysql/mysql-server:8.0.23
Upvotes: 4
Reputation: 3347
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
docker pull --platform linux/x86_64 ibmcom/db2:latest
Upvotes: 3
Reputation: 21
Change the platform in docker command
Param : --platform linux/x86_64
Upvotes: 2
Reputation: 7487
From this answer, I added this to my local docker-compose.override.yml
services:
mysql:
platform: linux/amd64
Upvotes: 187
Reputation: 289
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
Upvotes: 2
Reputation: 652
This works for me in mac M1, specifying platform key inside service.
services:
mysql:
platform: linux/amd64
image: mysql:latest
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
ports:
- 3306:3306
Upvotes: 21
Reputation: 21
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
Upvotes: 1
Reputation: 649
Docker on its official documentation says:
Not all images are available for ARM64 architecture. You can add
--platform linux/amd64
to run an Intel image under emulation. In particular, the mysql image is not available for ARM64. You can work around this issue by using a mariadb image.
(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:
services:
mysql:
image: mysql:5.7
platform: linux/amd64
...
As you can imagine probably the performance won't be the same.
Upvotes: 44
Reputation: 3730
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.
docker build -t 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.
Upvotes: 2
Reputation: 31
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:
[ERROR] [MY-012585] [InnoDB] Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB.
[Warning] [MY-012654] [InnoDB] Linux Native AIO disabled.
Consider using mysql/mysql-server instead, as it has arm64/v8 support out of the box.
Upvotes: 2
Reputation: 1180
can try start/run a container (for mac m1)
docker run -d -p 3306:3306 --name mysql --platform linux/x86_64 --env MYSQL_ROOT_PASSWORD=12345 mysql
Upvotes: 11
Reputation: 3898
same problem for m1 mac just run this command
docker pull --platform linux/x86_64 mysql
Upvotes: 361
Reputation: 909
For anyone struggling to make it work with a specific version, the following didn't work for me:
docker run --platform linux/x86_64 mysql:5.7.26 -e MYSQL_ROOT_PASSWORD=pass
but this did:
docker run --platform linux/x86_64 mysql:5.7 -e MYSQL_ROOT_PASSWORD=pass
Upvotes: 14
Reputation: 1551
Please refer to the following link for known issues. In your Mac's terminal run
softwareupdate --install-rosetta
and then in docker-compose have something along the lines of
mysql_gdpr:
platform: linux/x86_64
image: mysql/mysql-server:8.0.23
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: "user_security"
MYSQL_RANDOM_ROOT_PASSWORD: 1
MYSQL_USER: "security"
MYSQL_PASSWORD: "pleasechangeit"
Upvotes: 8
Reputation: 403
I had a similar issue, solved with this line in my dockerfile:
before
FROM ubuntu:18.04
after
FROM --platform=linux/x86_64 ubuntu:18.04
Upvotes: 40
Reputation: 929
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
version: "3.8"
services:
mysql:
container_name: mycontainername
image: mysql/mysql-server:8.0.23
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: mydatabasename
MYSQL_ROOT_HOST: "%"
command: --lower_case_table_names=1
Upvotes: 65
Reputation: 8876
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:
services:
db:
platform: linux/x86_64
image: mysql:5.7
...
Alternatively, consider using MariaDB, which should work as a drop-in replacement like e.g. this:
services:
db:
image: mariadb:10.5.8
...
Both ways work for me on M1 with the Docker Preview
Upvotes: 886