Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/local/bin/gunicorn Exec format error Apple M1 Chip

I'm using gke engine to run the docker image. Whenever I'm pushing the container it says exec /usr/local/bin/gunicorn exec format error. I can see this error inside the pod log.

Using macbook m1 pro chip

Here is my Docker file:

FROM python:3.7
WORKDIR /app
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
RUN ls -la ./
EXPOSE 80
ENTRYPOINT ["gunicorn", "-w", "2", "-b", ":80", "main:app", "--timeout", "300"]

How can I solve it?

like image 438
talkandtalkers Avatar asked Feb 06 '26 01:02

talkandtalkers


1 Answers

change the base image to be compatible with platform change to below if for a linux or add any related platform

FROM --platform=linux/amd64 python:3.7

This worked for me in AWS, for other ways to handle visit this

like image 69
sitaram chikkala Avatar answered Feb 07 '26 14:02

sitaram chikkala