From 9aac2dbe7f3d633620a64c9c805bce1722a446e8 Mon Sep 17 00:00:00 2001 From: sickcodes Date: Wed, 16 Nov 2022 14:25:24 +0000 Subject: [PATCH] Fix keyring `pacman-key --populate archlinux` --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5327998..9f1032d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,9 +67,14 @@ ARG RANKMIRRORS ARG MIRROR_COUNTRY=US ARG MIRROR_COUNT=10 +# Fixes issue with invalid GPG keys: update the archlinux-keyring package to get the latest keys, then remove and regenerate gnupg keys +RUN rm -rf /etc/pacman.d/gnupg \ + && pacman-key --init \ + && pacman-key --populate archlinux + RUN if [[ "${RANKMIRRORS}" ]]; then \ { pacman -Sy wget --noconfirm || pacman -Syu wget --noconfirm ; } \ - ; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/rankmirrors" \ + ; wget -O ./rankmirrors "https://raw.githubusercontent.com/sickcodes/Docker-OSX/${BRANCH:=master}/rankmirrors" \ ; wget -O- "https://www.archlinux.org/mirrorlist/?country=${MIRROR_COUNTRY:-US}&protocol=https&use_mirror_status=on" \ | sed -e 's/^#Server/Server/' -e '/^#/d' \ | head -n "$((${MIRROR_COUNT:-10}+1))" \ @@ -80,9 +85,6 @@ RUN if [[ "${RANKMIRRORS}" ]]; then \ && cat /etc/pacman.d/mirrorlist \ ; fi -# Fixes issue with invalid GPG keys: update the archlinux-keyring package to get the latest keys, then remove and regenerate gnupg keys -RUN pacman -Sy archlinux-keyring --noconfirm && rm -rf /etc/pacman.d/gnupg && pacman-key --init && pacman-key --populate - RUN tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkp://keyserver.ubuntu.com' \ && tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkps://hkps.pool.sks-keyservers.net:443' \ && tee -a /etc/pacman.d/gnupg/gpg.conf <<< 'keyserver hkp://pgp.mit.edu:11371' \