我正在一个docker容器上将python库编译为ARM体系结构。
我正在关注这篇文章中的示例:https://nmilosev.svbtle.com/compling-arm-stuff-without-an-arm-board-build-pytorch-for-the-raspberry-pi
首先,我使用此docker文件创建基于Fedora的映像:
FROM fedora
RUN yum -y update && yum clean all \
&& yum -y install nginx && yum clean all \
&& yum -y install git-core \
&& sudo dnf -y install qemu-system-arm qemu-user-static virt-manager
WORKDIR /app
COPY . /app
然后我将容器启动为:
sudo docker run -it mycontainer
但是获得ARM版本的fedora的可能性正在下降:
sudo dnf install --releasever=30 --installroot=/tmp/F30ARM --forcearch=armv7hl --repo=fedora --repo=updates systemd passwd dnf fedora-release vim-minimal openblas-devel blas-devel m4 cmake python3-Cython python3-devel python3-yaml python3-pillow python3-setuptools python3-numpy python3-cffi python3-wheel gcc-c++ tar gcc git make tmux -y
我遇到的第一个错误是在按Enter键后出现的:
sudo: setrlimit(RLIMIT_CORE): Operation not permitted
如果我不使用sudo,这会消失,所以我只运行:
dnf install --releasever=30 --installroot=/tmp/F30ARM --forcearch=armv7hl --repo=fedora --repo=updates systemd passwd dnf fedora-release vim-minimal openblas-devel blas-devel m4 cmake python3-Cython python3-devel python3-yaml python3-pillow python3-setuptools python3-numpy python3-cffi python3-wheel gcc-c++ tar gcc git make tmux -y
但是某些自由主义还是会失败,然后之间的常见错误似乎是:
chroot: failed to run command ‘/bin/sh’: No such file or directory
此外,如果我尝试以以下方式启动容器:
sudo docker run -it fedora-base /bin/bash
我收到另一个错误:
/bin/bash: /bin/bash: cannot execute binary file