skip to Main Content

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


  1. 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:

    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9D6D8F6BC857C906 AA8E81B4331F7F50 7638D0442B90D010
    

    Then, the start of your Dockerfile could be something like this:

    FROM jenkins:1.596
    
    USER root
    RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9D6D8F6BC857C906 AA8E81B4331F7F50 7638D0442B90D010
    RUN apt-get update
    ...
    

    Greetings.

    Login or Signup to reply.
  2. To fix your problem:

     the public key is not available: NO_PUBKEY 7638D0442B90D010
    

    Debian, just try :

    sudo apt-get install debian-keyring debian-archive-keyring
    
    sudo apt-key update
    
    sudo apt-get update
    

    Or, you should add the below in your Dockerfile:

    FROM jenkins:1.596
    
    USER root
    
    RUN apt-get install debian-keyring debian-archive-keyring
    
    RUN apt-key update
    
    RUN apt-get update
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search