5

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
  • 16,189
  • 4
  • 33
  • 81
Alien
  • 13,439
  • 5
  • 35
  • 53

2 Answers2

18

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

2

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
  • 26,923
  • 21
  • 73
  • 125
dnltinney
  • 149
  • 8
  • 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