Я создал следующий файл Dockerfile, чтобы установить библиотеку и импортировать свой код:
Код: Выделить всё
FROM balenalib/raspberrypi4-64-debian:latest
RUN apt-get update && apt-get install -y \
git python3 python3-pip python3-dev cython3 \
build-essential g++ curl cmake \
libgraphicsmagick++-dev libboost-python-dev \
libboost-system-dev
RUN git clone --recursive https://github.com/hzeller/rpi-rgb-led-matrix.git
RUN ls -R /rpi-rgb-led-matrix/
WORKDIR /rpi-rgb-led-matrix
RUN make clean && make -j$(nproc)
RUN ls -R /rpi-rgb-led-matrix/lib/
WORKDIR /rpi-rgb-led-matrix/bindings/python
RUN python3 setup.py build_ext --inplace
RUN python3 setup.py install
WORKDIR /app
COPY . /app
CMD ["python3", "display_gifs.py"]
Код: Выделить всё
=> ERROR [ 9/12] RUN python3 setup.py build_ext --inplace 1.8s
------
> [ 9/12] RUN python3 setup.py build_ext --inplace:
1.320 running build_ext
1.345 building 'core' extension
1.347 creating build
1.350 creating build/temp.linux-aarch64-3.9
1.350 creating build/temp.linux-aarch64-3.9/rgbmatrix
1.350 aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-PN012d/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-PN012d/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../include -I/usr/include/python3.9 -c rgbmatrix/core.cpp -o build/temp.linux-aarch64-3.9/rgbmatrix/core.o -O3 -Wall
1.386 aarch64-linux-gnu-gcc: error: rgbmatrix/core.cpp: No such file or directory
1.389 aarch64-linux-gnu-gcc: fatal error: no input files
1.389 compilation terminated.
1.390 error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1
------
Dockerfile:28
--------------------
27 | WORKDIR /rpi-rgb-led-matrix/bindings/python
28 | >>> RUN python3 setup.py build_ext --inplace
29 | RUN python3 setup.py install
30 |
--------------------
ERROR: failed to solve: process "/bin/sh -c python3 setup.py build_ext --inplace" did not complete successfully: exit code: 1
Может ли кто-нибудь увидеть, что я делаю неправильно, или предложить альтернативное решение?
Из того, что я исследовал, эта ошибка случалась и у других людей, и владелец библиотеки рекомендовал ее переустановить, но это не работает с моим Dockerfile.
Подробнее здесь: https://stackoverflow.com/questions/791 ... ix-library