From ec470e74bb77255a538dfad0a4986c406d0e1f9d Mon Sep 17 00:00:00 2001 From: Christian Geller <88664444+cgeller@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:15:53 +0200 Subject: [PATCH 1/4] Align ROS keyring with official ROS Docker images --- docker/Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index d7797f5..10f65ce 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -22,8 +22,9 @@ RUN apt-get update && \ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 && \ echo "deb http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list ; \ else \ - curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null ; \ + # align keyring name with official ROS images + curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros2-latest-archive-keyring.gpg && \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros2-latest-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2-latest.list > /dev/null ; \ fi && \ rm -rf /var/lib/apt/lists/* @@ -168,8 +169,9 @@ RUN apt-get update && \ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 && \ echo "deb http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list ; \ else \ - curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null ; \ + # align keyring name with official ROS images + curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros2-latest-archive-keyring.gpg && \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros2-latest-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2-latest.list > /dev/null ; \ fi && \ rm -rf /var/lib/apt/lists/* From 34cb005f32821bc32fe63bde81fbae76a770b939 Mon Sep 17 00:00:00 2001 From: Christian Geller <88664444+cgeller@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:28:39 +0200 Subject: [PATCH 2/4] Temporarily clone forked repository --- .gitlab-ci/docker-ros.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci/docker-ros.yml b/.gitlab-ci/docker-ros.yml index 3f22462..e21b25b 100644 --- a/.gitlab-ci/docker-ros.yml +++ b/.gitlab-ci/docker-ros.yml @@ -43,7 +43,7 @@ variables: VCS_IMPORT_FILE: .repos # Relative filepath to file containing additional repos to install via vcstools (only relevant if ENABLE_RECURSIVE_VCS_IMPORT=false) ENABLE_RECURSIVE_VCS_IMPORT: 'true' # Enable recursive discovery of files named `*.repos` # ----- - DOCKER_ROS_GIT_REF: main + DOCKER_ROS_GIT_REF: patch-1 _RUN_IMAGE: ${IMAGE_NAME}:${IMAGE_TAG} _DEV_IMAGE: ${DEV_IMAGE_NAME}:${DEV_IMAGE_TAG} @@ -88,7 +88,7 @@ default: - |- if [[ ! -d docker/docker-ros ]]; then mkdir -p docker - git clone --depth=1 https://github.com/ika-rwth-aachen/docker-ros.git docker/docker-ros + git clone --depth=1 https://github.com/cgeller/docker-ros.git docker/docker-ros cd docker/docker-ros git fetch origin ${DOCKER_ROS_GIT_REF} git checkout FETCH_HEAD From c6711060b872d054da06bae6df2942ab09a240a9 Mon Sep 17 00:00:00 2001 From: Christian Geller <88664444+cgeller@users.noreply.github.com> Date: Mon, 19 Aug 2024 14:53:11 +0200 Subject: [PATCH 3/4] Add query to identify existing keyrings --- docker/Dockerfile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 10f65ce..ac68022 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -18,13 +18,12 @@ ENV ROS_DISTRO=${ROS_DISTRO} RUN test -n "$ROS_DISTRO" || (echo "missing build-arg: ROS_DISTRO" && false) RUN apt-get update && \ apt-get install -y curl gnupg && \ - if [[ "$ROS_DISTRO" == "noetic" ]]; then \ + if [[ "$ROS_DISTRO" == "noetic" ]] && ! cat /etc/apt/sources.list /etc/apt/sources.list.d/* | grep "http://packages.ros.org/ros/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main"; then \ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 && \ echo "deb http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list ; \ - else \ - # align keyring name with official ROS images - curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros2-latest-archive-keyring.gpg && \ - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros2-latest-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2-latest.list > /dev/null ; \ + elif ! cat /etc/apt/sources.list /etc/apt/sources.list.d/* | grep "http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main"; then \ + curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null ; \ fi && \ rm -rf /var/lib/apt/lists/* @@ -165,13 +164,12 @@ ENV ROS_DISTRO=${ROS_DISTRO} RUN test -n "$ROS_DISTRO" || (echo "missing build-arg: ROS_DISTRO" && false) RUN apt-get update && \ apt-get install -y curl gnupg && \ - if [[ "$ROS_DISTRO" == "noetic" ]]; then \ + if [[ "$ROS_DISTRO" == "noetic" ]] && ! cat /etc/apt/sources.list /etc/apt/sources.list.d/* | grep "http://packages.ros.org/ros/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main"; then \ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 && \ echo "deb http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list ; \ - else \ - # align keyring name with official ROS images - curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros2-latest-archive-keyring.gpg && \ - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros2-latest-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2-latest.list > /dev/null ; \ + elif ! cat /etc/apt/sources.list /etc/apt/sources.list.d/* | grep "http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main"; then \ + curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null ; \ fi && \ rm -rf /var/lib/apt/lists/* From 408a5fd8c43ad2e72cd7ff974a35cecd8b0d211d Mon Sep 17 00:00:00 2001 From: Christian Geller <88664444+cgeller@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:04:25 +0200 Subject: [PATCH 4/4] Revert 34cb005 --- .gitlab-ci/docker-ros.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci/docker-ros.yml b/.gitlab-ci/docker-ros.yml index e21b25b..3f22462 100644 --- a/.gitlab-ci/docker-ros.yml +++ b/.gitlab-ci/docker-ros.yml @@ -43,7 +43,7 @@ variables: VCS_IMPORT_FILE: .repos # Relative filepath to file containing additional repos to install via vcstools (only relevant if ENABLE_RECURSIVE_VCS_IMPORT=false) ENABLE_RECURSIVE_VCS_IMPORT: 'true' # Enable recursive discovery of files named `*.repos` # ----- - DOCKER_ROS_GIT_REF: patch-1 + DOCKER_ROS_GIT_REF: main _RUN_IMAGE: ${IMAGE_NAME}:${IMAGE_TAG} _DEV_IMAGE: ${DEV_IMAGE_NAME}:${DEV_IMAGE_TAG} @@ -88,7 +88,7 @@ default: - |- if [[ ! -d docker/docker-ros ]]; then mkdir -p docker - git clone --depth=1 https://github.com/cgeller/docker-ros.git docker/docker-ros + git clone --depth=1 https://github.com/ika-rwth-aachen/docker-ros.git docker/docker-ros cd docker/docker-ros git fetch origin ${DOCKER_ROS_GIT_REF} git checkout FETCH_HEAD