Reputation: 33
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?
Upvotes: 3
Views: 3661
Reputation: 311
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
Upvotes: 4
Reputation: 1535
“exec format” error means the architecture of the Docker image and your host system does not match. You must use container images that are compatible with the architecture of the node where you intend to run the workloads
Check this documentation on building multi-arch images on GKE
Upvotes: 0