[ubuntu] Remove apt-key from build scripts (#9082)

This commit is contained in:
Shamil Mubarakshin
2023-12-29 18:11:55 +01:00
committed by GitHub
parent 1658c2e905
commit 266f9413d3
5 changed files with 52 additions and 25 deletions

View File

@@ -19,11 +19,12 @@ fi
# Packages is available in the official Ubuntu upstream starting from Ubuntu 21
if is_ubuntu20; then
REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable"
source /etc/os-release
sh -c "echo 'deb ${REPO_URL}/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
wget -nv https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key
apt-key add Release.key
REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_$(lsb_release -rs)"
GPG_KEY="/usr/share/keyrings/devel_kubic_libcontainers_stable.gpg"
REPO_PATH="/etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
curl -fsSL "${REPO_URL}/Release.key" | gpg --dearmor -o $GPG_KEY
echo "deb [arch=amd64 signed-by=$GPG_KEY] ${REPO_URL}/ /" > $REPO_PATH
fi
# Install podman, buildah, scopeo container's tools
@@ -34,7 +35,9 @@ printf "[registries.search]\nregistries = ['docker.io', 'quay.io']\n" | tee /etc
if is_ubuntu20; then
# Remove source repo
rm /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
rm $GPG_KEY
rm $REPO_PATH
# Document source repo
echo "containers $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt
fi