forked from NVIDIA-ISAAC-ROS/isaac_ros_common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.x86_64
194 lines (170 loc) · 6.14 KB
/
Dockerfile.x86_64
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
# Docker file to build on x86_64
# https://docs.nvidia.com/deeplearning/frameworks/user-guide/index.html
ARG BASE_IMAGE=nvcr.io/nvidia/tritonserver:22.09-py3
FROM ${BASE_IMAGE}
# disable terminal interaction for apt
ENV DEBIAN_FRONTEND=noninteractive
ENV SHELL /bin/bash
SHELL ["/bin/bash", "-c"]
# NVIDIA repository keys: https://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/
RUN apt-key del 7fa2af80 && mkdir -p /tmp && cd /tmp \
&& wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb \
&& dpkg -i cuda-keyring_1.0-1_all.deb \
&& rm cuda-keyring_1.0-1_all.deb \
&& add-apt-repository --remove 'deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /'
# Fundamentals
RUN apt-get update && apt-get install -y \
apt-transport-https \
bash-completion \
build-essential \
ca-certificates \
clang-format \
cmake \
curl \
git \
gnupg2 \
iputils-ping \
locales \
lsb-release \
rsync \
software-properties-common \
wget \
vim \
unzip \
mlocate \
libgoogle-glog-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Set Python3 as default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
# Python basics
RUN apt-get update && apt-get install -y \
python3-pip \
python3-pybind11 \
python3-pytest-cov \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Video utilities
RUN apt-get update && apt-get install -y \
v4l-utils \
mesa-utils \
libcanberra-gtk-module \
libcanberra-gtk3-module \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Core dev libraries
RUN apt-get update && apt-get install -y \
libasio-dev \
libbullet-dev \
libtinyxml2-dev \
libcunit1-dev \
libopencv-dev \
python3-opencv \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Python3 (PIP)
RUN python3 -m pip install -U \
argcomplete \
autopep8 \
flake8==4.0.1 \
flake8-blind-except \
flake8-builtins \
flake8-class-newline \
flake8-comprehensions \
flake8-deprecated \
flake8-docstrings \
flake8-import-order \
flake8-quotes \
onnx \
pytest-repeat \
pytest-rerunfailures \
pytest \
pydocstyle \
scikit-learn
# Install Git-LFS
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get update && apt-get install -y \
git-lfs \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Upgrade cmake to 3.23.2
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null \
&& echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
&& apt-get update \
&& apt-get update \
&& apt-get remove -y cmake && apt-get purge -y cmake && apt-get remove -y cmake-data && apt-get purge -y cmake \
&& apt-get install -y cmake=3.23.2-0kitware1ubuntu20.04.1 cmake-data=3.23.2-0kitware1ubuntu20.04.1 \
&& cmake --version \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Pytorch
RUN python3 -m pip install -U --extra-index-url https://download.pytorch.org/whl/cu113 \
torch \
torchvision \
torchaudio
# Install VPI packages
ARG HAS_GPU="true"
RUN if [ "$HAS_GPU" = "true" ]; then \
set -e ; \
apt-key adv --fetch-key https://repo.download.nvidia.com/jetson/jetson-ota-public.asc ; \
add-apt-repository 'deb http://repo.download.nvidia.com/jetson/x86_64/focal r35.2 main' ; \
apt-get update ; \
apt-get install libnvvpi2 vpi2-dev ; \
rm -rf /var/lib/apt/lists/* ; \
fi
# Install Tao converter
RUN mkdir -p /opt/nvidia/tao && \
cd /opt/nvidia/tao && \
wget https://developer.nvidia.com/tao-converter-80 && \
unzip tao-converter-80 && \
chmod 755 $(find /opt/nvidia/tao -name "tao-converter") && \
ln -sf $(find /opt/nvidia/tao -name "tao-converter") /opt/nvidia/tao/tao-converter && \
rm tao-converter-80
ENV PATH="${PATH}:/opt/nvidia/tao"
# Update environment
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/tritonserver/lib"
# Add MQTT binaries and libraries
RUN apt-add-repository ppa:mosquitto-dev/mosquitto-ppa \
&& apt-get update \
&& apt-get install -y mosquitto mosquitto-clients \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
RUN python3 -m pip install -U \
paho-mqtt
# Upgrade libc to resolve vulnerabilities including CVE-2019-11477
RUN apt-get update && apt-get install -y --only-upgrade \
linux-libc-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Downgrade protobuf
RUN python3 -m pip install \
protobuf==3.20.1
# GPU usage monitoring on x86
RUN python3 -m pip install \
gpustat==0.6.0
# Python3 (PIP)
RUN python3 -m pip install -U \
mailcap-fix
# Resolve vulnerability in mailcap.py by removing it (CVE-2015-20107)
RUN rm -f /opt/tritonserver/backends/dali/conda/envs/dalienv/lib/python3.8/mailcap.py
# Remove any platform entangling dependencies
RUN touch \
/usr/lib/x86_64-linux-gnu/libcuda.so \
/usr/lib/x86_64-linux-gnu/libnvcuvid.so \
/usr/lib/x86_64-linux-gnu/libnvidia.so \
/usr/lib/firmware \
/usr/local/cuda/compat/lib || true
RUN rm -rf \
/usr/lib/x86_64-linux-gnu/libcuda.so* \
/usr/lib/x86_64-linux-gnu/libnvcuvid.so* \
/usr/lib/x86_64-linux-gnu/libnvidia-*.so* \
/usr/lib/firmware \
/usr/local/cuda/compat/lib || true