My docker images were working fine as soon as I moved to my new Mac M1 Max. Even with my M1 Max, I have installed docker and successfully created image, and pushed to AWS ECR. Now when I'm running that image, it doesn't run but throws an error
exec /usr/local/bin/python3: exec format error
My Dockerfile looks like below but no luck yet. The same error everytime. I know that it's not straight forward to built docker images on Mac M1 Max and run them but in many StackOverflow answers I found that the below addition --platform=linux/arm64
helps but not in my case yet.
FROM --platform=linux/amd64 python:3.8-slim-buster
# FROM --platform=linux/arm64 python:3.8-slim-buster (tried this one as well)
# FROM --platform=linux/arm64/v8 python:3.8-slim-buster (tried this one as well)
WORKDIR /project
COPY ./requirements.txt .
RUN apt-get -qq update
RUN pip3 --quiet install --requirement requirements.txt \
--force-reinstall --upgrade
COPY . .
--platform=linux/amd64
might have something to do with it. M1 is a arm cpu. – Psych