File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -60,14 +60,15 @@ RUN apt-get update -y -qq && \
6060 tar \
6161 unzip \
6262 wget \
63- && \
63+ &&\
6464 : "remove cache" && \
6565 rm -rf /var/lib/apt/lists/*
6666
67- # add the ROS 2 GPG key with apt and setup sources.list
68- RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
69- sh -c 'echo "deb [arch=amd64,arm64] http://repo.ros2.org/ubuntu/main `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list' && \
70- curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
67+ # Setup keys
68+ RUN set -eux; \
69+ 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}') \
70+ && curl -L -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" \
71+ && apt install /tmp/ros2-apt-source.deb
7172
7273# setup environment
7374ENV LANG=C.UTF-8
Original file line number Diff line number Diff line change @@ -63,10 +63,12 @@ RUN apt-get update -y -qq && \
6363 : "remove cache" && \
6464 rm -rf /var/lib/apt/lists/*
6565
66- # add the ROS 2 GPG key with apt and setup sources.list
67- RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
68- sh -c 'echo "deb [arch=amd64,arm64] http://repo.ros2.org/ubuntu/main `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list' && \
69- curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
66+
67+ # Setup keys
68+ RUN set -eux; \
69+ 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}') \
70+ && curl -L -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" \
71+ && apt install /tmp/ros2-apt-source.deb
7072
7173# setup environment
7274ENV LANG=C.UTF-8
You can’t perform that action at this time.
0 commit comments