forked from dusty-nv/jetson-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
79 lines (63 loc) · 2.32 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#---
# name: deepstream
# group: ml
# config: config.py
# requires: '>=32.6'
# depends: [cuda, cudnn, tensorrt, cmake, python, gstreamer, tritonserver]
# test: [test.sh, test.py]
# notes: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Quickstart.html
#---
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG DEEPSTREAM_URL
ARG DEEPSTREAM_TAR
ARG DEEPSTREAM_VERSION
RUN wget --quiet --show-progress --progress=bar:force:noscroll --no-check-certificate ${DEEPSTREAM_URL} -O ${DEEPSTREAM_TAR} && \
tar -xvf ${DEEPSTREAM_TAR} -C / && \
rm ${DEEPSTREAM_TAR}
# https://github.com/dusty-nv/jetson-containers/issues/405#issue-2155595703
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python-is-python3 \
|| rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# install librdkafka (to enable Kafka protocol adaptor for message broker)
RUN git clone https://github.com/edenhill/librdkafka && \
cd librdkafka && \
git reset --hard 7101c2310341ab3f4675fc565f64f0967e135a6a && \
./configure && \
make -j$(nproc) && \
make install && \
cd ../ && \
rm -rf librdkafka
RUN cp /usr/local/lib/librdkafka* /opt/nvidia/deepstream/deepstream-*/lib
# libyaml-cpp.so.0.6: cannot open shared object file
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libyaml-cpp-dev \
libcairo2-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# install DeepStream
RUN cd /opt/nvidia/deepstream/deepstream-* && \
./install.sh && \
ldconfig
# build pyds bindings
# https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/tree/master/bindings
ARG PYDS_VERSION
ARG PYTHON_VERSION_MAJOR
ARG PYTHON_VERSION_MINOR
RUN cd /opt/nvidia/deepstream/deepstream/sources && \
git clone --branch ${PYDS_VERSION} --recursive --depth=1 https://github.com/NVIDIA-AI-IOT/deepstream_python_apps && \
cd deepstream_python_apps/bindings && \
mkdir build && \
cd build && \
cmake ../ \
-DDS_PATH=/opt/nvidia/deepstream/deepstream \
-DPIP_PLATFORM=linux_aarch64 \
-DPYTHON_MAJOR_VERSION=${PYTHON_VERSION_MAJOR} \
-DPYTHON_MINOR_VERSION=${PYTHON_VERSION_MINOR} && \
make -j$(nproc) && \
pip3 install --verbose ./pyds-*-py3-none*.whl
# make sure it loads
RUN deepstream-app --version && python3 -c 'import pyds'