I’m trying to build an image on my Windows machine (Docker for Desktop v20.10.11), for my Raspberry Pi OS machine. The image will compile fine and run on my Windows machine. I understand the underlying architectures are different, so below are the associated files and commands to get my image built for arm7. As the image is built it’ll throw errors for ‘No matching distributions’ for all the modules in the requirements.txt.
What I’ve tried (the dockerfile and requirements file will build a working image on Windows)
- Tried pulling the elements of the requirements file into the Dockerfile as RUN statements… tried variants of pip, apt-get, and sudo apt-get
- Tried changing pandas==1.2.1 to python3-pandas (both inside and out of the requirements file)
- Tried shortening the --platform args to just ar/7 in both buildx and standard build
I feel like there is some kind of syntax I’m missing but in all of me research I haven’t figured out what it is. I appreciate the help.
FROM python:3.7-slim-buster RUN mkdir app COPY . /app WORKDIR /app RUN pip install -r requirements.txt --no-cache-dir VOLUME ./data ./static EXPOSE 5000 ENTRYPOINT [ "python","app.py" ] CMD ["flask", "run", "--host", "172.17.0.2" ]
pandas==1.2.1 matplotlib==3.0.2 flask==1.1.1
docker buildx create --use docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -t image_name_x .