Skip to content

Commit 5401ad1

Browse files
Use ros-apt-source
1 parent 738efe4 commit 5401ad1

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

ros2_rhel/Dockerfile.rhel8

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
FROM almalinux:8
22
ARG ROS_DISTRO=rolling
33

4-
# install ros
5-
ADD http://packages.ros.org/ros2/rhel/ros2.repo /etc/yum.repos.d/ros2.repo
4+
5+
# ROS prerequisites
6+
# see https://docs.ros.org/en/humble/Installation/RHEL-Install-RPMs.html
67
RUN dnf install \
78
'dnf-command(config-manager)' \
89
epel-release \
@@ -16,6 +17,11 @@ RUN dnf install \
1617
&& dnf config-manager --set-enabled powertools \
1718
&& dnf clean all
1819

20+
# Setup Sources
21+
RUN 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}') && \
22+
dnf install "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-release-${ROS_APT_SOURCE_VERSION}-1.noarch.rpm"
23+
24+
# install ros
1925
ENV ROS_DISTRO=${ROS_DISTRO}
2026
RUN dnf install -y ros-${ROS_DISTRO}-ros-base \
2127
python3-rosdep \

ros2_rhel/Dockerfile.rhel9

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@ ARG ROS_DISTRO=rolling
33

44
# ROS prerequisites
55
# see https://docs.ros.org/en/rolling/Installation/RHEL-Install-RPMs.html
6-
RUN dnf install -y langpacks-en glibc-langpack-en \
7-
&& dnf clean all && \
6+
RUN dnf install -y langpacks-en glibc-langpack-en \ && \
87
export LANG=en_US.UTF-8 && \
98
dnf install -y 'dnf-command(config-manager)' epel-release && \
10-
dnf config-manager --set-enabled crb
9+
dnf config-manager --set-enabled crb \
10+
&& dnf clean all
11+
12+
# Setup Sources
13+
RUN 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}') && \
14+
dnf install "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-release-${ROS_APT_SOURCE_VERSION}-1.noarch.rpm"
1115

12-
# COPY http://packages.ros.org/ros2/rhel/ros2.repo /etc/yum.repos.d/ros2.repo
13-
ADD http://packages.ros.org/ros2-testing/rhel/ros2-testing.repo /etc/yum.repos.d/ros2.repo
16+
# install ros
1417
RUN dnf makecache -y
1518
RUN dnf install -y \
1619
gcc-c++ \

0 commit comments

Comments
 (0)