FROM balenalib/raspberrypi3-python:latest-stretch-build #Enforces cross-compilation through Quemu RUN [ "cross-build-start" ] RUN install_packages \ sudo \ build-essential \ curl \ libcurl4-openssl-dev \ libssl-dev \ wget \ python3 \ python3-pip \ python3-dev \ git \ tar RUN pip3 install --upgrade pip RUN pip3 install --upgrade setuptools RUN pip3 install --upgrade wheel RUN pip3 install numpy # Build the latest cmake WORKDIR /code RUN wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz; RUN tar zxf cmake-3.12.3.tar.gz WORKDIR /code/cmake-3.12.3 RUN ./configure --system-curl RUN make RUN sudo make install # Set up build args ARG BUILDTYPE=MinSizeRel ARG BUILDARGS="--config ${BUILDTYPE} --arm" # Prepare onnxruntime Repo WORKDIR /code RUN git clone --recursive https://github.com/Microsoft/onnxruntime # Start the basic build WORKDIR /code/onnxruntime RUN ./build.sh ${BUILDARGS} --update --build # Build Shared Library RUN ./build.sh ${BUILDARGS} --build_shared_lib # Build Python Bindings and Wheel RUN ./build.sh ${BUILDARGS} --enable_pybind --build_wheel # Build Output RUN ls -l /code/onnxruntime/build/Linux/${BUILDTYPE}/*.so RUN ls -l /code/onnxruntime/build/Linux/${BUILDTYPE}/dist/*.whl RUN [ "cross-build-end" ]