forked from dusty-nv/jetson-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (50 loc) · 1.69 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#---
# name: realsense
# group: hardware
# depends: [cuda, python, cmake]
# test: test.py
# notes: https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md
#---
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libssl-dev \
libusb-1.0-0-dev \
libgtk-3-dev \
libglfw3-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
qtcreator \
udev && \
if [ $(lsb_release -cs) = "bionic" ]; then \
apt-get install -y --no-install-recommends python-dev; \
else \
apt-get install -y --no-install-recommends python2-dev; \
fi \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# https://github.com/IntelRealSense/librealsense/issues/11931
# ARG LIBREALSENSE_VERSION=development
# https://github.com/dusty-nv/jetson-containers/issues/398
ARG LIBREALSENSE_VERSION=master
RUN git clone --branch ${LIBREALSENSE_VERSION} --depth=1 https://github.com/IntelRealSense/librealsense && \
cd librealsense && \
mkdir build && \
cd build && \
cmake \
-DBUILD_EXAMPLES=true \
-DFORCE_RSUSB_BACKEND=true \
-DBUILD_WITH_CUDA=true \
-DCMAKE_BUILD_TYPE=release \
-DBUILD_PYTHON_BINDINGS=bool:true \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DPYTHON_INSTALL_DIR=$(python3 -c 'import sys; print(f"/usr/lib/python{sys.version_info.major}.{sys.version_info.minor}/dist-packages")') \
../ && \
make -j$(($(nproc)-1)) && \
make install && \
cd ../ && \
cp ./config/99-realsense-libusb.rules /etc/udev/rules.d/ && \
rm -rf librealsense
RUN python3 -c 'import pyrealsense2'
#RUN udevadm control --reload-rules && udevadm trigger