forked from dusty-nv/jetson-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ros.eloquent
108 lines (93 loc) · 3 KB
/
Dockerfile.ros.eloquent
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
#
# this dockerfile roughly follows the 'Install ROS2 Via Debian Packages' from:
# https://index.ros.org/doc/ros2/Installation/Eloquent/Linux-Install-Debians/
#
ARG BASE_IMAGE=nvcr.io/nvidia/l4t-base:r32.5.0
FROM ${BASE_IMAGE}
ARG ROS_PKG=ros_base
ENV ROS_DISTRO=eloquent
ENV ROS_ROOT=/opt/ros/${ROS_DISTRO}
ENV DEBIAN_FRONTEND=noninteractive
ENV SHELL /bin/bash
SHELL ["/bin/bash", "-c"]
WORKDIR /tmp
# 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
#
# add the ROS deb repo to the apt sources list
#
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
cmake \
build-essential \
curl \
wget \
gnupg2 \
lsb-release \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
#
# install ROS packages
#
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ros-eloquent-`echo "${ROS_PKG}" | tr '_' '-'` \
ros-eloquent-launch-xml \
ros-eloquent-launch-yaml \
ros-eloquent-launch-testing \
ros-eloquent-launch-testing-ament-cmake \
ros-eloquent-camera-calibration-parsers \
ros-eloquent-camera-info-manager \
ros-eloquent-cv-bridge \
ros-eloquent-v4l2-camera \
ros-eloquent-vision-msgs \
ros-eloquent-vision-opencv \
ros-eloquent-image-transport \
ros-eloquent-image-tools \
ros-eloquent-image-geometry \
ros-eloquent-gazebo-ros \
ros-eloquent-gazebo-msgs \
ros-eloquent-gazebo-ros-pkgs \
ros-eloquent-gazebo-plugins \
libpython3-dev \
python3-colcon-common-extensions \
python3-rosdep \
libgazebo9-dev \
gazebo9 \
gazebo9-common \
gazebo9-plugin-base \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
#
# init/update rosdep
#
RUN apt-get update && \
cd ${ROS_ROOT} && \
rosdep init && \
rosdep update && \
rm -rf /var/lib/apt/lists/*
#
# compile yaml-cpp-0.6, which some ROS packages may use (but is not in the 18.04 apt repo)
#
RUN git clone --branch yaml-cpp-0.6.0 https://github.com/jbeder/yaml-cpp yaml-cpp-0.6 && \
cd yaml-cpp-0.6 && \
mkdir build && \
cd build && \
cmake -DBUILD_SHARED_LIBS=ON .. && \
make -j$(nproc) && \
cp libyaml-cpp.so.0.6.0 /usr/lib/aarch64-linux-gnu/ && \
ln -s /usr/lib/aarch64-linux-gnu/libyaml-cpp.so.0.6.0 /usr/lib/aarch64-linux-gnu/libyaml-cpp.so.0.6
#
# setup entrypoint
#
COPY ./packages/ros_entrypoint.sh /ros_entrypoint.sh
RUN echo 'source /opt/ros/${ROS_DISTRO}/setup.bash' >> /root/.bashrc
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]
WORKDIR /