This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.runtime
108 lines (88 loc) · 3.49 KB
/
Dockerfile.runtime
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
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
ARG BASE_DIST
ARG CUDA_VERSION
ARG OPENCV_VERSION
# Intra layer OpenCV
FROM rbonghi/isaac-ros-base:opencv-${OPENCV_VERSION} as opencv_builder
RUN cp /opt/opencv/build/OpenCV-*.tar.gz /OpenCV.tar.gz
FROM nvidia/cuda:${CUDA_VERSION}-runtime-${BASE_DIST}
# L4T variables
ARG JETPACK=5.0.2
ARG L4T=35.1
ARG L4T_MINOR_VERSION=1.0
# NVIDIA software
ARG TENSORRT_VERSION=8.4
ARG TRITON_VERSION=2.24.0
# Disable terminal interaction for apt
ENV DEBIAN_FRONTEND=noninteractive
ENV SHELL /bin/bash
SHELL ["/bin/bash", "-c"]
# ROS2 Humble installation
# https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Development-Setup.html
# Fundamentals
RUN apt-get update && apt-get install -y \
locales \
software-properties-common \
build-essential \
cmake \
git \
git-lfs \
wget \
unzip \
curl \
gnupg \
# Python requirements
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# change the locale from POSIX to UTF-8
RUN locale-gen en_US en_US.UTF-8 && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV PYTHONIOENCODING=utf-8
# Set Python3 as default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
# Python dependencies
RUN python3 -m pip install -U \
numpy
########### Sources and main Jetson repo ###################
COPY scripts/variables.sh /variables.sh
COPY scripts/install_nvidia_sources.sh install_nvidia_sources.sh
RUN TERM=xterm bash install_nvidia_sources.sh ${L4T} \
&& rm install_nvidia_sources.sh
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/cuda/compat"
########### VPI & TensorRT #################################
RUN apt-get update \
&& apt-get install -y tensorrt libnvvpi2 vpi2-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/nvidia/vpi2/lib64"
############ OpenCV ########################################
# Load from OpenCV builder tar file
COPY --from=opencv_builder /OpenCV.tar.gz /opt/OpenCV.tar.gz
# Install OpenCV on system
COPY scripts/install_opencv.sh /opt/install_opencv.sh
RUN TERM=xterm bash /opt/install_opencv.sh ${OPENCV_VERSION} \
&& rm /opt/install_opencv.sh /opt/OpenCV.tar.gz
############################################################
COPY scripts/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]