I have an application I run on Docker which works fine on my older intel-based Mac. However, on the M1 Mac, I get pip install errors when running docker-compose up. e.g
asyncpg==0.24.0
error: command 'gcc' failed: No such file or directory
My Dockerfile uses python-slim which has no compiler, so I understand why:
FROM python:3.10-slim
WORKDIR /src
COPY . ./
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
I'd like to stick to the -slim package. What is the best way to make this work on the Mac M1?
Thanks!
I had a similar issue and forcing the platform to linux/amd64 fixed it:
FROM --platform=linux/amd64 python:3.10-slim
See known issues:
Not all images are available for ARM64 architecture. You can add
--platform linux/amd64to run an Intel image under emulation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With