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!
2
Answers
You can install missing packages like this on a Debian image. I’ve had the same issue in the past with the normal Postgres adapter.
Make sure to put it before your pip install RUN directives.
I had a similar issue and forcing the platform to
linux/amd64
fixed it:See known issues: