9

I was following the official docker labs hands-on tutorial for multi-container apps tutorials. While running the below command on MacBook Pro M1 terminal

docker run -d `
    --network todo-app --network-alias mysql `
    -v todo-mysql-data:/var/lib/mysql `
    -e MYSQL_ROOT_PASSWORD=secret `
    -e MYSQL_DATABASE=todos `
    mysql:5.7

I am getting the below error.

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

aheze
  • 24,434
  • 8
  • 68
  • 125
Alien
  • 15,141
  • 6
  • 37
  • 57

3 Answers3

25

If anyone else runs into this issue while following the guide on a Mac M1 machine specifically, the quickest work-around is probably to add the flag:

--platform linux/amd64

like

docker run -d \
    --platform linux/amd64 \
    --network todo-app --network-alias mysql \
    -v todo-mysql-data:/var/lib/mysql \
    -e MYSQL_ROOT_PASSWORD=secret \
    -e MYSQL_DATABASE=todos \
    mysql:5.7

Credits to https://github.com/docker/getting-started/issues/144

Pasta Alfredo
  • 251
  • 2
  • 3
3

When you check the offical mysql image, you can see there is no mention of linux/arm64/v8

In the case of mysql docker docs even states that:

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.

So you could use mariadb as a workaround, until they offer official support for mysql like so:

docker run -d \
  -v todo-mysql-data:/var/lib/mysql \
  -e MYSQL_ROOT_PASSWORD=secret \
  -e MYSQL_DATABASE=todos \
  mariadb:10.5

See: github.com/docker-library/mysql/issues/318

If you really need the mysql image you could try the workaround mentioned in the same issue here. As of now I can't test this, because I don't have an m1 macbook.

Dharman
  • 30,962
  • 25
  • 85
  • 135
0xdnL
  • 384
  • 3
  • 10
  • I saw this already as part of my research before posting this. https://stackoverflow.com/q/65456814/6572971 – Alien Apr 25 '21 at 16:41
0

Incase you are using docker compose for your container ochestration you can have your docker-compose.yaml file mirror something similar to this

services:
  mysql:
  platform: linux/amd64
  #you can use whatever image you prefer
  image: "mysql:5.7" 
  
Elsis
  • 286
  • 3
  • 5