I’m trying to build my docker image for a Raspberry Pi 4 from my Ubuntu machine running on a VMWare Virtual Machine.
Every time I run the command docker buildx build -t nicocaldo/accumulator . --platform linux/arm/v7
Docker build until the RUN pip install
and it fails with output error:
=> ERROR [7/8] RUN pip install --requirement requirements.txt 0.3s
------
> [7/8] RUN pip install --requirement requirements.txt:
#15 0.262 standard_init_linux.go:228: exec user process caused: exec format error
------
error: failed to solve: executor failed running [/bin/sh -c pip install --requirement requirements.txt]: exit code: 1
I have tried to use just RUN pip install pyserial
without any requirements.txt file but got the same error
My Dockerfile is below
# syntax=docker/dockerfile:1
FROM python:3.8-slim-buster
WORKDIR /app
COPY *.py ./
COPY *.txt ./
ADD ./db ./db
ADD ./etc ./etc
RUN pip install --requirement requirements.txt
ADD list_ports_linux.py usr/local/lib/python3.8/site-packages/serial/tools/
ENTRYPOINT [ "python3" ]
# default
CMD [ "./daemon.py" ]