[build] Fix issues caused by docker.com gpg key update. (#14063)

Why I did it
docker.com's gpg key start to work from 2023-02-23. While debian.org's gpg key expired in 2022-11.
We used a walkaround for security checking for debian gpg keys. Now we need to exclude docker.com's gpg key.

How I did it
Update docker.com's gpg key without faketime.
Update others' gpg key with faketime '2022-11'

How to verify it
This commit is contained in:
Liu Shilong 2023-03-06 10:18:29 +08:00 committed by GitHub
parent fb0751bc84
commit ef0c6f34ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -359,16 +359,15 @@ RUN apt-get install -y \
gnupg2 \
software-properties-common
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
RUN add-apt-repository \
"deb [arch={{ CONFIGURED_ARCH }}] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
RUN faketime "2022-11-01" apt-get update
RUN echo "deb [arch={{ CONFIGURED_ARCH }}] https://download.docker.com/linux/debian $(lsb_release -cs) stable" >> /etc/apt/sources.list.d/docker.list
RUN apt-get update -o Dir::Etc::sourcelist="sources.list.d/docker.list"
{%- if CONFIGURED_ARCH == "amd64" %}
RUN apt-get install -y docker-ce=17.03.2~ce-0~debian-jessie
{%- else %}
RUN apt-get install -y docker-ce=18.06.3~ce~3-0~debian
{%- endif %}
RUN rm /etc/apt/sources.list.d/docker.list
RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs\"" >> /etc/default/docker
# For jenkins slave