I’m following this guide for the installation of Docker inside a Jenkins container
This is the Dockerfile of the Jenkins container:
FROM jenkins:1.596
USER root
RUN apt-get update
RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers
# setup docker repository
RUN apt-get install
RUN apt-get update
RUN echo "deb http://httpredir.debian.org/debian jessie-backports main contrib non-free" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-transport-https
&& ca-certificates
&& curl
&& gnupg-agent
&& software-properties-common
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN apt-key fingerprint 0EBFCD88
RUN add-apt-repository
"deb [arch=amd64] https://download.docker.com/linux/debian
$(lsb_release -cs)
stable"
# install docker engine
RUN apt-get update
RUN apt-get install docker-ce docker-ce-cli containerd.io
USER jenkins
When I build the image I get these errors:
Reading package lists...
W: GPG error: http://security.debian.org jessie/updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9D6D8F6BC857C906 NO_PUBKEY AA8E81B4331F7F50
W: GPG error: http://http.debian.net jessie-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010
W: GPG error: http://http.debian.net jessie Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7638D0442B90D010
2
Answers
The apt has a set of trusted keys and sometimes we only need to add the ones that are missing.
You can add the missing keys just by running the following command:
Then, the start of your Dockerfile could be something like this:
Greetings.
To fix your problem:
Debian, just try :
Or, you should add the below in your Dockerfile: