Define Dockerfile with AM64 platform on M1 Apple
Time over time I’m building docker images that can only be run on x64. To force M1 Mac
FROM --platform=linux/amd64 ubuntu:22.04
export DOCKER_DEFAULT_PLATFORM=linux/amd64
- In docker compose
```yaml
services:
frontend:
platform: linux/amd64 build: frontend
ports:- 80:80
depends_on: - backend
backend:
platform: linux/amd64 build: backend
```
- 80:80
docker buildx build --platform linux/amd64 .
Source:
That's it for this post, thanks for reading!