diff --git a/Dockerfile b/Dockerfile
index 1f824da307b3b9f0fb0e86c45d815269fd1dcf4a..d86ecfbd6830281788abd21e8534398700b23739 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,7 +3,7 @@ FROM debian:bullseye-slim
 COPY build.sh /tmp/build.sh
 COPY python37_compat.patch /tmp/python37_compat.patch
 COPY chaperone.conf /etc/chaperone.d/chaperone.conf
-COPY deb_autistici_org.gpg /etc/apt/trusted.gpg.d/
+COPY deb_autistici_org.gpg /usr/share/keyrings/deb.autistici.org.gpg
 
 RUN /tmp/build.sh && rm /tmp/build.sh
 
diff --git a/build.sh b/build.sh
index c433a77305cb6661c79a6f65630cf69a6c96d0b6..458975d1c3fdfff5eb9af4d8c374fc25b94b2a40 100755
--- a/build.sh
+++ b/build.sh
@@ -29,7 +29,7 @@ die() {
 set -x
 
 # Add the ai3 Debian package repository.
-echo "deb http://deb.autistici.org/urepo ai3/" \
+echo "deb [signed-by=/usr/share/keyrings/deb.autistici.org.gpg] http://deb.autistici.org/urepo float/bullseye/" \
     > /etc/apt/sources.list.d/ai3.list
 apt-get -q update