forked from dusty-nv/jetson-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ros2
47 lines (35 loc) · 1.12 KB
/
Dockerfile.ros2
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
#
# Dockerfile for building ROS2 from source
#
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG ROS_PACKAGE=ros_base
ARG ROS_VERSION=humble
ENV ROS_DISTRO=${ROS_VERSION}
ENV ROS_ROOT=/opt/ros/${ROS_DISTRO}
ENV ROS_PYTHON_VERSION=3
ENV DEBIAN_FRONTEND=noninteractive
ENV SHELL /bin/bash
SHELL ["/bin/bash", "-c"]
WORKDIR /tmp
# change the locale from POSIX to UTF-8
RUN apt-get update && \
apt-get install -y --no-install-recommends locales \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
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
# build ROS from source
COPY ros2_build.sh ros2_build.sh
RUN ./ros2_build.sh
# Set the default DDS middleware to cyclonedds
# https://github.com/ros2/rclcpp/issues/1335
ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
# commands will be appended/run by the entrypoint which sources the ROS environment
COPY ros_entrypoint.sh /ros_entrypoint.sh
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["/bin/bash"]
WORKDIR /