Skip to content

Commit c156987

Browse files
authored
26 update key setup system (#27)
* updated key setup method * updated for noetic
1 parent 4563cb6 commit c156987

File tree

2 files changed

+19
-24
lines changed

2 files changed

+19
-24
lines changed

humble/Dockerfile

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,19 @@ RUN echo 'Asia/Kolkata' > /etc/timezone && \
2727

2828
# install packages
2929
RUN apt-get update && apt-get install -q -y --no-install-recommends \
30+
ca-certificates \
31+
curl \
3032
dirmngr \
3133
gnupg2 \
3234
&& rm -rf /var/lib/apt/lists/*
3335

34-
# setup keys
35-
RUN set -eux; \
36-
key='C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654'; \
37-
export GNUPGHOME="$(mktemp -d)"; \
38-
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \
39-
mkdir -p /usr/share/keyrings; \
40-
gpg --batch --export "$key" > /usr/share/keyrings/ros2-latest-archive-keyring.gpg; \
41-
gpgconf --kill all; \
42-
rm -rf "$GNUPGHOME"
43-
44-
# setup sources.list
45-
RUN echo "deb [ signed-by=/usr/share/keyrings/ros2-latest-archive-keyring.gpg ] http://packages.ros.org/ros2/ubuntu jammy main" > /etc/apt/sources.list.d/ros2-latest.list
36+
# Setup ROS Apt sources
37+
RUN curl -L -s -o /tmp/ros2-apt-source.deb https://github.com/ros-infrastructure/ros-apt-source/releases/download/1.1.0/ros2-apt-source_1.1.0.jammy_all.deb \
38+
&& echo "1600cb8cc28258a39bffc1736a75bcbf52d1f2db371a4d020c1b187d2a5a083b /tmp/ros2-apt-source.deb" | sha256sum --strict --check \
39+
&& apt-get update \
40+
&& apt-get install /tmp/ros2-apt-source.deb \
41+
&& rm -f /tmp/ros2-apt-source.deb \
42+
&& rm -rf /var/lib/apt/lists/*
4643

4744
# setup environment
4845
ENV LANG=C.UTF-8

noetic/Dockerfile

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,21 @@ RUN echo 'Asia/Kolkata' > /etc/timezone && \
2424
apt-get install -q -y --no-install-recommends tzdata && \
2525
rm -rf /var/lib/apt/lists/*
2626

27+
# install packages
2728
RUN apt-get update && apt-get install -q -y --no-install-recommends \
29+
ca-certificates \
30+
curl \
2831
dirmngr \
2932
gnupg2 \
3033
&& rm -rf /var/lib/apt/lists/*
3134

32-
# setup keys
33-
RUN set -eux; \
34-
key='C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654'; \
35-
export GNUPGHOME="$(mktemp -d)"; \
36-
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \
37-
mkdir -p /usr/share/keyrings; \
38-
gpg --batch --export "$key" > /usr/share/keyrings/ros1-latest-archive-keyring.gpg; \
39-
gpgconf --kill all; \
40-
rm -rf "$GNUPGHOME"
41-
42-
# setup sources.list
43-
RUN echo "deb [ signed-by=/usr/share/keyrings/ros1-latest-archive-keyring.gpg ] http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list
35+
# Setup ROS Apt sources
36+
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}') ;\
37+
curl -L -s -o /tmp/ros-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb" \
38+
&& apt-get update \
39+
&& apt-get install /tmp/ros-apt-source.deb \
40+
&& rm -f /tmp/ros-apt-source.deb \
41+
&& rm -rf /var/lib/apt/lists/*
4442

4543
# setup environment
4644
ENV LANG=C.UTF-8

0 commit comments

Comments
 (0)