Skip to content

Commit bf77cde

Browse files
Use rhel10 for rolling
1 parent ddcb163 commit bf77cde

2 files changed

Lines changed: 126 additions & 1 deletion

File tree

.github/workflows/build_and_publish_rhel_docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
rhel_version: rhel9
4242
source_packages: pinocchio
4343
- ros_distro: rolling
44-
rhel_version: rhel9
44+
rhel_version: rhel10
4545
source_packages: pinocchio
4646
steps:
4747
- uses: actions/checkout@v6

ros2_rhel/Dockerfile.rhel10

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
FROM almalinux:10
2+
ARG ROS_DISTRO=rolling
3+
4+
# ROS prerequisites
5+
# see https://docs.ros.org/en/rolling/Installation/RHEL-Install-RPMs.html
6+
RUN dnf install -y langpacks-en glibc-langpack-en && \
7+
export LANG=en_US.UTF-8 && \
8+
dnf install -y 'dnf-command(config-manager)' epel-release && \
9+
dnf config-manager --set-enabled crb && \
10+
dnf clean all
11+
12+
# Setup Sources
13+
RUN set -eux; \
14+
export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}') && \
15+
if [ -z "$ROS_APT_SOURCE_VERSION" ]; then \
16+
echo "Failed to fetch ROS_APT_SOURCE_VERSION" >&2; \
17+
exit 1; \
18+
fi ; \
19+
ROS_RPM_URL="https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-release-${ROS_APT_SOURCE_VERSION}-1.noarch.rpm" ; \
20+
echo "Installing ROS RPM: $ROS_RPM_URL" ; \
21+
dnf install -y "$ROS_RPM_URL"
22+
23+
# install system dependencies
24+
RUN dnf makecache -y
25+
RUN dnf install -y \
26+
ccache \
27+
gcc-c++ \
28+
git \
29+
make \
30+
patch \
31+
boost-devel \
32+
libcap-devel \
33+
urdfdom \
34+
urdfdom-devel \
35+
python3-colcon-common-extensions \
36+
python3-mypy \
37+
python3-pip \
38+
python3-pydocstyle \
39+
python3-pytest \
40+
python3-pytest-repeat \
41+
python3-pytest-rerunfailures \
42+
python3-rosdep \
43+
python3-rosinstall_generator \
44+
python3-rospkg \
45+
python3-setuptools \
46+
python3-vcstool \
47+
wget \
48+
&& dnf clean all
49+
50+
# install some pip packages needed for testing and
51+
# not available as RPMs
52+
# use the same versions as on Ubuntu Jammy
53+
RUN python3 -m pip install --no-cache-dir -U --user \
54+
flake8==4.0.1 \
55+
pyflakes==2.4.0 \
56+
flake8-blind-except==0.1.1 \
57+
flake8-class-newline \
58+
flake8-deprecated \
59+
colcon-mixin
60+
61+
# install ros-base
62+
ENV ROS_DISTRO=${ROS_DISTRO}
63+
RUN dnf install -y \
64+
ros-${ROS_DISTRO}-ros-base \
65+
ros-${ROS_DISTRO}-backward-ros \
66+
ros-${ROS_DISTRO}-pal-statistics \
67+
ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \
68+
ros-${ROS_DISTRO}-sdformat-urdf \
69+
ros-${ROS_DISTRO}-xacro \
70+
&& rosdep init \
71+
&& dnf clean all
72+
73+
# install cmake 3.22.1 (the same version as Ubuntu Jammy default). Needed for RSL
74+
WORKDIR /usr
75+
RUN \
76+
wget --progress=dot:giga https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1-linux-x86_64.tar.gz && \
77+
tar --strip-components=1 -xzf cmake-3.22.1-linux-x86_64.tar.gz && \
78+
rm cmake-3.22.1-linux-x86_64.tar.gz
79+
80+
# setup colcon mixin and metadata
81+
RUN colcon mixin add default \
82+
https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
83+
colcon mixin update && \
84+
colcon metadata add default \
85+
https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \
86+
colcon metadata update
87+
88+
# build generate_parameter_library and other deps from source
89+
ENV ROS2_WS=/opt/ros2_ws
90+
ARG SOURCE_PACKAGES=""
91+
WORKDIR $ROS2_WS
92+
RUN \
93+
. /opt/ros/$ROS_DISTRO/setup.sh && \
94+
if [ -n "$SOURCE_PACKAGES" ]; then \
95+
for i in {1..5}; do \
96+
rosinstall_generator $SOURCE_PACKAGES --rosdistro $ROS_DISTRO \
97+
> deps.repos && break || echo "retry #${i} .." && sleep 60; \
98+
done && \
99+
mkdir -p src && \
100+
vcs import src < deps.repos && \
101+
rosdep update --rosdistro $ROS_DISTRO && \
102+
rosdep install -iyr --from-path src ; \
103+
fi && \
104+
colcon build \
105+
--mixin release build-testing-off \
106+
--cmake-args --no-warn-unused-cli --packages-skip pinocchio && \
107+
# build pinocchio from source
108+
colcon build \
109+
--mixin release build-testing-off \
110+
--cmake-args --no-warn-unused-cli -DBUILD_EXAMPLES=OFF -DBUILD_PYTHON_INTERFACE=OFF \
111+
--packages-select pinocchio && \
112+
# cleanup
113+
rm -rf log src build
114+
115+
# add default.yaml to the image
116+
COPY defaults.yaml /root/.colcon/defaults.yaml
117+
118+
# there is no python3-graphviz on rhel9, so install it via pip
119+
RUN pip3 install --no-cache-dir graphviz
120+
121+
# Setup entrypoint (sourcing of ROS)
122+
COPY ./ros_entrypoint.sh /
123+
RUN chmod +x /ros_entrypoint.sh
124+
ENTRYPOINT [ "/ros_entrypoint.sh" ]
125+
CMD ["bash"]

0 commit comments

Comments
 (0)