[Solved] M1 Docker Image Platform Mismatch With Host (ARM64)

If you get the following error when trying to run a Docker container that was built on an M1 mac:

M1 docker preview and keycloak 'image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8)' Issue

The solution

Then you can do simply add the following argument to your docker build command.

--platform linux/amd64

Where this goes

docker build --platform linux/amd64 -t your_docker_item .