C++ 在x86主机上为arm32v7在Docker中构建libtorrent失败,错误为(未知目标类型EXE)

C++ 在x86主机上为arm32v7在Docker中构建libtorrent失败,错误为(未知目标类型EXE),c++,docker,g++,libtorrent,b2,C++,Docker,G++,Libtorrent,B2,我正在尝试为RPI4的libtorrent构建一个静态python绑定。我写了一个Dockerfile,它在RPI4上工作(尽管速度非常慢)。但是,如果我尝试在ubuntu上使用qemu user static或Windows 10上使用Docker Desktop构建相同的Dockerfile,我会遇到这个错误 Step 25/26 : RUN b2 -j1 libtorrent-link=static boost-link=static stage_module ---> Runni

我正在尝试为RPI4的libtorrent构建一个静态python绑定。我写了一个Dockerfile,它在RPI4上工作(尽管速度非常慢)。但是,如果我尝试在ubuntu上使用
qemu user static
或Windows 10上使用Docker Desktop构建相同的Dockerfile,我会遇到这个错误

Step 25/26 : RUN b2 -j1 libtorrent-link=static boost-link=static stage_module
 ---> Running in be922d0723d7
/root/boost_1_74_0/tools/build/src/build/type.jam:158: in type.validate from module type
error: Unknown target type EXE
(builtin):-1: in sequence.transform from module sequence
/root/boost_1_74_0/tools/build/src/build/generators.jam:239: in generator.__init__ from module object(installed-exe-generator)@4
/root/boost_1_74_0/tools/build/src/tools/stage.jam:568: in class@installed-exe-generator.__init__ from module object(installed-exe-generator)@4
/root/boost_1_74_0/tools/build/src/kernel/class.jam:90: in new from module class
/root/boost_1_74_0/tools/build/src/tools/stage.jam:596: in load from module stage
/root/boost_1_74_0/tools/build/src/kernel/modules.jam:295: in import from module modules
/root/boost_1_74_0/tools/build/src/tools/builtin.jam:27: in load from module builtin
/root/boost_1_74_0/tools/build/src/kernel/modules.jam:295: in import from module modules
/root/boost_1_74_0/tools/build/src/build-system.jam:12: in load from module build-system
/root/boost_1_74_0/tools/build/src/kernel/modules.jam:295: in import from module modules
/root/boost_1_74_0/tools/build/src/kernel/bootstrap.jam:139: in boost-build from module
/root/boost_1_74_0/tools/build/boost-build.jam:8: in module scope from module

The command '/bin/sh -c b2 -j1 libtorrent-link=static boost-link=static stage_module' returned a non-zero code: 1
这是我正在使用的Dockerfile

FROM arm32v7/ubuntu:latest

# this part so that tzdata does not ask for user input during the building process
ENV TZ=Europe/Kiev
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR /root
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get install -y build-essential git wget python3.6 python3.6-dev libpython3.6-dev
RUN wget --no-check-certificate https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.gz
RUN git clone --recurse-submodules https://github.com/arvidn/libtorrent.git
ENV CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:/usr/include/python3.6m"
RUN tar -xzf boost_1_74_0.tar.gz
WORKDIR /root/boost_1_74_0/tools/build
RUN ./bootstrap.sh
RUN cp src/engine/b2 /usr/local/bin/b2
ENV BOOST_ROOT=/root/boost_1_74_0/
ENV BOOST_BUILD_PATH=/root/boost_1_74_0/tools/build/
WORKDIR /root
RUN echo "using gcc : : : <cxxflags>-std=c++14 ;" > user-config.jam
RUN echo "using python : 3.6 : /usr/bin/python3.6 ;" >> user-config.jam
WORKDIR /root/libtorrent
RUN git checkout RC_1_2
WORKDIR /root/libtorrent/bindings/python
RUN b2 -j1 libtorrent-link=static boost-link=static stage_module
来自arm32v7/ubuntu的
最新版本
#这一部分可以使tzdata在构建过程中不要求用户输入
ENV TZ=欧洲/基辅
运行ln-snf/usr/share/zoneinfo/$TZ/etc/localtime&&echo$TZ>/etc/timezone
WORKDIR/root
运行apt获取更新
运行apt get install-y软件属性common
运行添加apt存储库ppa:deadsnakes/ppa
运行apt获取更新
运行apt get install-y build-essential git wget-python3.6-python3.6-dev-libpython3.6-dev
运行wget--无检查证书https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.gz
运行git clone--递归子模块https://github.com/arvidn/libtorrent.git
ENV CPLUS_INCLUDE_PATH=“${CPLUS_INCLUDE_PATH}:/usr/INCLUDE/python3.6m”
运行tar-xzf boost_1_74_0.tar.gz
WORKDIR/root/boost\u 1\u 74\u 0/tools/build
运行/bootstrap.sh
运行cp src/engine/b2/usr/local/bin/b2
ENV BOOST\u ROOT=/ROOT/BOOST\u 1\u 74\u 0/
ENV BOOST\u BUILD\u PATH=/root/BOOST\u 1\u 74\u 0/tools/BUILD/
WORKDIR/root
运行echo“使用gcc::-std=c++14;”>user-config.jam
运行echo“使用python:3.6:/usr/bin/python3.6;”>>user-config.jam
WORKDIR/root/libtorrent
运行git签出RC_1_2
WORKDIR/root/libtorrent/bindings/python
运行b2-j1 libtorrent链路=静态增压链路=静态级模块

您在这两种情况下使用的boost版本是否相同?@Arvid是的,我使用的是相同的版本。此外,我还发现在x86上构建arm容器时,
b2
根本不起作用。有关更多详细信息,请参见本文。这真的很烦人,因为在RPi上本机构建应用程序需要很长时间。