-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.x86
180 lines (152 loc) · 6.02 KB
/
Dockerfile.x86
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
# Copyright (C) 2022, Raffaello Bonghi <[email protected]>
# All rights reserved
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Docker file to build on x86_64
# https://docs.nvidia.com/deeplearning/frameworks/user-guide/index.html
FROM nvcr.io/nvidia/tritonserver:24.10-py3
# disable terminal interaction for apt
ENV DEBIAN_FRONTEND=noninteractive
# Fundamentals
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
# Fundamentals
RUN apt-get update && apt-get install -y \
bash-completion \
build-essential \
clang-format \
cmake \
curl \
git \
gnupg2 \
locales \
lsb-release \
rsync \
software-properties-common \
wget \
vim \
unzip \
mlocate \
libgoogle-glog-dev \
&& rm -rf /var/lib/apt/lists/*
# Python basics
RUN apt-get update && apt-get install -y \
python3-flake8 \
python3-opencv \
python3-pip \
python3-pytest-cov \
python3-setuptools \
&& rm -rf /var/lib/apt/lists/*
# 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/*
# Core dev libraries
RUN apt-get update && apt-get install -y \
libasio-dev \
libbullet-dev \
libtinyxml2-dev \
libcunit1-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Git-LFS and other packages
RUN apt-get update && apt-get install -y \
git-lfs \
software-properties-common && \
rm -rf /var/lib/apt/lists/*
################ INSTALL ROS ####################
ENV ROS_DISTRO foxy
# Setup ROS2 Foxy
RUN locale-gen en_US en_US.UTF-8
RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG=en_US.UTF-8
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
RUN sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
RUN apt-get update && apt-get install -y \
python3-colcon-common-extensions \
python3-rosdep \
python3-vcstool \
ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \
ros-${ROS_DISTRO}-camera-calibration-parsers \
ros-${ROS_DISTRO}-camera-info-manager \
ros-${ROS_DISTRO}-desktop \
ros-${ROS_DISTRO}-launch-testing-ament-cmake \
ros-${ROS_DISTRO}-rqt* \
ros-${ROS_DISTRO}-turtlesim \
ros-${ROS_DISTRO}-v4l2-camera \
ros-${ROS_DISTRO}-vision-msgs \
ros-${ROS_DISTRO}-pcl-conversions \
ros-${ROS_DISTRO}-sensor-msgs-py \
ros-${ROS_DISTRO}-stereo-image-proc \
ros-${ROS_DISTRO}-pcl-ros \
&& rm -rf /var/lib/apt/lists/*
################ DOWNLOAD ISAAC ROS ####################
# Download and build nanosaur_isaac_ros
ENV ISAAC_ROS_WS /opt/isaac_ros_ws
# Copy wstool isaac_ros.rosinstall
COPY nanosaur_perception/rosinstall/isaac_ros.rosinstall isaac_ros.rosinstall
RUN mkdir -p ${ISAAC_ROS_WS}/src && \
vcs import ${ISAAC_ROS_WS}/src < isaac_ros.rosinstall
# Pull LFS files
COPY nanosaur_perception/scripts/git_lfs_pull_ws.sh git_lfs_pull_ws.sh
RUN TERM=xterm bash git_lfs_pull_ws.sh ${ISAAC_ROS_WS}/src
# Install VPI packages
RUN mkdir -p /opt/install && \
mv ${ISAAC_ROS_WS}/src/isaac_ros_common/docker/vpi/*.deb /opt/install/ && \
dpkg -i /opt/install/vpi-lib-1.1.11-cuda11-x86_64-linux.deb; \
dpkg -i /opt/install/vpi-dev-1.1.11-cuda11-x86_64-linux.deb; \
updatedb;
################ INSTALL ISAAC ROS ####################
# Change workdir
WORKDIR $ISAAC_ROS_WS
# Build Isaac ROS
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
colcon build --symlink-install \
--cmake-args \
-DCMAKE_BUILD_TYPE=Release
################ NANOSAUR PKGS ####################
# Download and build nanosaur_perception
ENV ROS_WS /opt/ros_ws
RUN mkdir -p ${ROS_WS}/src
ADD . $ROS_WS/src/nanosaur_perception
# Change workdir
WORKDIR $ROS_WS
# Build Isaac ROS
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
. $ISAAC_ROS_WS/install/setup.sh && \
colcon build --symlink-install \
--cmake-args \
-DCMAKE_BUILD_TYPE=Release
################ Final enviroment setup ####################
RUN mv $ROS_WS/src/nanosaur_perception/nanosaur_perception/scripts/ros_entrypoint.sh /ros_entrypoint.sh
# Restore using the default Foxy DDS middleware: FastRTPS
ENV RMW_IMPLEMENTATION=rmw_fastrtps_cpp
STOPSIGNAL SIGINT
# source ros package from entrypoint
RUN sed --in-place --expression \
'$isource "$ROS_WS/install/setup.bash"' \
/ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
# run ros package launch file
CMD ["ros2", "launch", "nanosaur_perception", "simulation.launch.py"]