Chapter 6: PostgressSQL M1 docker error

So I ran this command in terminal:

docker run --name postgres -e POSTGRES_DB=vapor \
-e POSTGRES_USER=vapor -e POSTGRES_PASSWORD=password \
-p 5432:5432 -d postgres

After deleting previous versions of postgres I’m dealing with the following error:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested c06a0a524230e0b108d98d6e5eeb1af063db38747b3df4dbfcadacd32a7f78cd

I did a full brew uninstall cask and downloaded the Apple Chip version of desktop Docker. But I am still getting this error.

Any help would be appreciated as it’s stalled me in the book.

Just to confirm - when you look at Docker in the activity monitor it says it’s being run under Apple Silicon rather than Intel?

If so, stop and kill the Postgres container (docker rm -f postgres) then remove the Postgres image. Run docker image ls find the image ID for Postgres and then run docker rmi <IMAGE_ID> - that should force it to pull down the latest ARM version of Postgres and work

That seems to have done the job! Thanks!!