Skip to content

Commit 738efe4

Browse files
Use ros2-apt-source for ubuntu images (#349)
* Use ros2-apt-source * Fix testing repo * Use our own image for pre-commit
1 parent 3cc3c15 commit 738efe4

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

.github/workflows/reusable-pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
pre-commit:
1515
runs-on: ubuntu-latest
16-
container: ros:${{ inputs.ros_distro }}
16+
container: ghcr.io/ros-controls/ros:${{ inputs.ros_distro }}-ubuntu
1717
env:
1818
# this will be src/{repo-owner}/{repo-name}
1919
path: src/${{ github.repository }}

ros2_ubuntu/Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,23 @@ RUN echo 'Etc/UTC' > /etc/timezone && \
2828

2929
# Install packages
3030
RUN apt-get update && apt-get install -q -y --no-install-recommends \
31+
software-properties-common \
3132
dirmngr \
3233
gnupg2 \
3334
lsb-release \
35+
curl \
36+
&& add-apt-repository universe \
3437
&& rm -rf /var/lib/apt/lists/*
3538

3639
# Setup keys
3740
RUN set -eux; \
38-
key='C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654'; \
39-
export GNUPGHOME="$(mktemp -d)"; \
40-
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \
41-
mkdir -p /usr/share/keyrings; \
42-
gpg --batch --export "$key" > /usr/share/keyrings/ros2-latest-archive-keyring.gpg; \
43-
gpgconf --kill all; \
44-
rm -rf "$GNUPGHOME"
41+
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}') \
42+
&& curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2${ROS_REPO_PACKAGES}-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $UBUNTU_CODENAME)_all.deb" \
43+
&& apt install /tmp/ros2-apt-source.deb
4544

46-
# Setup sources.list
47-
RUN echo "deb [ signed-by=/usr/share/keyrings/ros2-latest-archive-keyring.gpg ] http://packages.ros.org/ros2${ROS_REPO_PACKAGES}/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros2-latest.list
4845
# Setup environment
4946
ENV LANG=C.UTF-8
5047
ENV LC_ALL=C.UTF-8
51-
5248
ENV ROS_DISTRO=${ROS_DISTRO}
5349

5450
# Install ROS packages and dev dependencies, which ros-tooling/setup-ros would install see

0 commit comments

Comments
 (0)