I'm trying to use docker with qemu to build an arm image in my x86 host computer
I use arm64v8/ubuntu as the based image
I make a simple opencv program and try to use ldd command to see the dependencies.
however, ldd always shows:
ldd: exited with unknown exit code (132)
ldd would work if I save this image and load it in an arm computer.
However, my main project's size is too large (or my arm computer's space is too small ) to import to the arm computer, I'd like to use ldd to find out which libraries are really necessary for this project.
I also try nvcr.io/nvidia/l4t-base:r32.4.4 as based image and ldd shows
ldd: exited with unknown exit code (139)
what should I do to use ldd command if i'm in a arm image in the docker and my host computer is x86?
my dockerfile are like this:
FROM arm64v8/ubuntu
ENV TZ=Asia/Taipei
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get install -y \
build-essential -y \
cmake -y \
git -y \
libgtk2.0-dev -y \
libjpeg-dev -y \
libpng-dev -y \
libtiff-dev -y \
pkg-config -y && \
apt-get clean
WORKDIR /home/gino/
RUN git clone https://github.com/opencv/opencv.git && \
cd ./opencv && \
mkdir build && \
cd build && \
cmake \
-D BUILD_SHARED_LIBS=ON \
-D WITH_QT=OFF \
-D WITH_OPENGL=OFF \
-D FORCE_VTK=OFF \
-D WITH_TBB=OFF \
-D WITH_GDAL=OFF \
-D WITH_V4L=ON \
-D WITH_XINE=OFF \
-D BUILD_EXAMPLES=OFF \
-D ENABLE_PRECOMPILED_HEADERS=OFF \
-D BUILD_DOCS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D BUILD_TESTS=OFF \
-D BUILD_opencv_apps=OFF \
-D CMAKE_INSTALL_PREFIX=/home/gino/opencv_install \
.. && \
make -j8 && \
make install && \
ldconfig && \
apt-get clean
WORKDIR /home/gino/
RUN rm -R ./opencv
ADD ./ /home/gino/cvtest/
WORKDIR /home/gino/cvtest/
RUN make clean all
ENV HOME /home/developer
CMD /home/gino/cvtest/dockertest
main.cpp
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat frame;
VideoCapture video(-1);
while(video.isOpened())
{
video>>frame;
imshow("frame",frame);
waitKey(1);
}
cout << "Hello World!" << endl;
return 0;
}