-
Notifications
You must be signed in to change notification settings - Fork 484
/
Dockerfile.ros2
36 lines (27 loc) · 971 Bytes
/
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
#
# Dockerfile for building ROS2 from source
#
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG ROS_PACKAGE=ros_base \
ROS_VERSION=humble
ENV ROS_DISTRO=${ROS_VERSION} \
ROS_ROOT=/opt/ros/${ROS_VERSION} \
ROS_PYTHON_VERSION=3 \
RMW_IMPLEMENTATION=rmw_fastrtps_cpp \
DEBIAN_FRONTEND=noninteractive \
SHELL=/bin/bash
SHELL ["/bin/bash", "-c"]
# set Python3 as default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
# build ROS from source
COPY ros2_build.sh /tmp/ros2_build.sh
RUN /tmp/ros2_build.sh
# Set the default DDS middleware to cyclonedds
# https://github.com/ros2/rclcpp/issues/1335
# https://docs.ros.org/en/jazzy/Installation/DDS-Implementations/Working-with-eProsima-Fast-DDS.html
#ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
# commands will be appended/run by the entrypoint which sources the ROS environment
COPY ros_entrypoint.sh ros2_install.sh /
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["/bin/bash"]