Skip to content

Commit aec47ef

Browse files
j-riveroJose Luis Rivero
authored andcommitted
Handle the new ROS image with key updated
Signed-off-by: Jose Luis Rivero <jrivero@honurobotics.com>
1 parent fda3596 commit aec47ef

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

docker/Dockerfile.base

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
FROM osrf/ros:jazzy-desktop-full AS vrx-base
33

44
# Workaround from https://discourse.ros.org/t/ros-signing-key-migration-guide/43937
5-
RUN rm /etc/apt/sources.list.d/ros2-latest.list \
6-
&& rm /usr/share/keyrings/ros2-latest-archive-keyring.gpg
5+
RUN rm -f /etc/apt/sources.list.d/ros2-latest.list \
6+
&& rm -f /usr/share/keyrings/ros2-latest-archive-keyring.gpg
77

8-
RUN apt-get update \
9-
&& apt-get install -y ca-certificates curl
10-
11-
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}') ;\
12-
curl -L -s -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb" \
13-
&& apt-get update \
14-
&& apt-get install /tmp/ros2-apt-source.deb \
15-
&& rm -f /tmp/ros2-apt-source.deb
8+
# Only install ros2-apt-source if it's not already installed
9+
RUN if ! dpkg -l | grep -q ros2-apt-source; then \
10+
apt-get update && \
11+
apt-get install -y ca-certificates curl && \
12+
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}') && \
13+
curl -L -s -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb" && \
14+
apt-get update && \
15+
apt-get install /tmp/ros2-apt-source.deb && \
16+
rm -f /tmp/ros2-apt-source.deb; \
17+
fi
1618

1719
ENV DEBIAN_FRONTEND=noninteractive
1820

0 commit comments

Comments
 (0)