Skip to content

Commit e22a736

Browse files
Replace apt-key in Dockerfile with gpg. (#187)
Summary: apt-key is getting deprecated in newer ubuntus; although we are using an older version for our docker base image, it's better to avoid using legacy stuff. Replacing the apt-key and apt-add repo updates with explicit gpg conversion (PGP to GPG) and add to sources.list. Pull Request resolved: #187 Test Plan: No functionality changes Reviewed By: d4l3k Differential Revision: D39778992 Pulled By: anirbanr-fb-r2p fbshipit-source-id: 78ac49352a9c6aaf8d3aba2f7eb0a9a94bee5a06
1 parent e5ab486 commit e22a736

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt \
4444
software-properties-common \
4545
python-pip \
4646
python3-pip && \
47-
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - && \
48-
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' && \
49-
echo "deb http://security.ubuntu.com/ubuntu focal-security main" >> /etc/apt/sources.list && \
47+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor -o /usr/share/keyrings/magic-key.gpg && \
48+
echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/magic-key.gpg] https://apt.kitware.com/ubuntu/ bionic main" | tee -a /etc/apt/sources.list && \
49+
echo "deb http://security.ubuntu.com/ubuntu focal-security main" | tee -a /etc/apt/sources.list && \
5050
apt update && \
5151
apt install -y binutils cmake && \
5252
rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)