-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
109 lines (89 loc) · 3.62 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Before building this image, check that docker build with nvidia runtime is activated
# Check the following link: https://stackoverflow.com/questions/59691207/docker-build-with-nvidia-runtime
# For GPUs
# FROM nvcr.io/nvidia/deepstream:6.0.1-devel
# For Jetson
FROM nvcr.io/nvidia/deepstream-l4t:6.0.1-samples
# To get video driver libraries at runtime
ENV LD_LIBRARY_PATH /usr/local/cuda-10.2/lib64
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES all
ENV LOGLEVEL="INFO"
ENV SHELL="/bin/bash"
# To save logs into a file
# RUN mkdir /workspace/output/
# ENV GST_DEBUG="INFO"
# ENV GST_DEBUG_FILE=/workspace/output/GST_DEBUG.log
# First update
RUN apt-get update --fix-missing
RUN apt-get -y install nano
# Installing some Gstream dependencies
RUN apt-get install -y gstreamer-1.0 gstreamer1.0-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
# Installing python3
RUN apt-get install -y python3.6 python3.6-dev python-dev \
python3-dev python3-pip \
python3-numpy python3-opencv
# Setting python3 as the base python
RUN update-alternatives --verbose --install /usr/bin/python python /usr/bin/python3 1
# Installing dependencies for compile gstream python
RUN apt install -y cmake g++ build-essential \
libglib2.0-dev libglib2.0-dev-bin python-gi-dev libtool m4 autoconf automake
# Compile Gstream for python bindings
RUN cd /opt/nvidia/deepstream/deepstream/sources/ \
&& git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps.git \
&& cd deepstream_python_apps \
&& git submodule update --init \
&& apt-get install -y apt-transport-https ca-certificates -y \
&& update-ca-certificates \
&& cd 3rdparty/gst-python/ \
&& ./autogen.sh \
&& make \
&& make install
# Compile Deepstream Python Bindings (# For Jetson devices)
RUN cd /opt/nvidia/deepstream/deepstream/sources/ \
&& cd deepstream_python_apps/bindings/ \
&& mkdir build \
&& cd build \
&& cmake .. -DPYTHON_MAJOR_VERSION=3 -DPYTHON_MINOR_VERSION=6 \
-DPIP_PLATFORM=linux_aarch64 -DDS_PATH=/opt/nvidia/deepstream/deepstream \
&& make \
&& pip3 install ./pyds-1.1.1-py3-none*.whl
# For compiling in GPUs devices
# Replace the line:
# && cmake .. -DPYTHON_MAJOR_VERSION=3 -DPYTHON_MINOR_VERSION=8 \
# -DPIP_PLATFORM=linux_aarch64 -DDS_PATH=/opt/nvidia/deepstream/deepstream
# by
# && cmake ..
# without any flags
# RTSP and Additional libraries
RUN apt-get install -y libgstrtspserver-1.0-0 gstreamer1.0-rtsp \
libgirepository1.0-dev gobject-introspection gir1.2-gst-rtsp-server-1.0
RUN apt -y install python3-gi python-gst-1.0 gir1.2-gstreamer-1.0
# Installing additional python libraries
RUN pip3 install coloredlogs
# Note: If your are not using Kafka locally avoid this step
# Install Java libraries for runing kafka locally
RUN apt-get update --fix-missing
RUN apt -y install default-jre
RUN apt -y install default-jdk
RUN apt -y install libglib2.0-dev libjson-glib-dev uuid-dev
# Downlod basic get started
RUN mkdir /opt/kafka/
RUN cd /opt/kafka/ \
&& wget https://dlcdn.apache.org/kafka/3.1.0/kafka_2.13-3.1.0.tgz \
&& tar -xzf kafka_2.13-3.1.0.tgz \
&& rm kafka_2.13-3.1.0.tgz
# Custom Bindings compilation
RUN pip3 install pybind11
COPY custom_libraries/ /opt/custom_libraries/
RUN cd /opt/custom_libraries/pyds_custom/ \
&& ./build.sh \
&& python setup.py install
# Setting entry point to run zookeeper and kafka broker
COPY deepstream-msg2kafka/run_kafka_server.sh /scripts/entrypoint.sh
RUN chmod +x /scripts/entrypoint.sh
ENTRYPOINT /scripts/entrypoint.sh
# COPY . /workspace
WORKDIR /workspace
# CMD python3 run.py "file:///app/data/videos/sample_720p.h264"