Dockerfile: migrate to trusted.gpg.d for docker repo keys (#3090)

Using apt-key for managing Debian repo keys has been deprecated for a
while now. While it currently works ok, seems to be broken in bookworm. This migrates to storing keys in trusted.gpg.d as recommended by the warning messages when using apt-key.
This commit is contained in:
Tim L 2024-01-19 21:02:34 +11:00 committed by GitHub
parent 3aa2c1e411
commit c210a1a52a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -12,8 +12,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gpg \ gpg \
dirmngr \ dirmngr \
software-properties-common \ software-properties-common \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \ && curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg \
&& add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" \ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/docker.gpg] \
https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list \
&& apt-get update && apt-get install -y --no-install-recommends \ && apt-get update && apt-get install -y --no-install-recommends \
docker-ce \ docker-ce \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*