Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker run mysql image command not working [MacBook Pro M1]

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.

like image 502
Alien Avatar asked Dec 06 '22 08:12

Alien


1 Answers

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

like image 141
Pasta Alfredo Avatar answered Dec 10 '22 10:12

Pasta Alfredo