question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docker build runs into GPG error

See original GitHub issue

While running docker build -t- as instructed here in Powershell I get the following error message:

> docker build -t unity-robotics:nav2-slam-example ./
> [+] Building 4.9s (7/13)
>  => [internal] load build definition from Dockerfile                                                               0.0s
>  => => transferring dockerfile: 3.23kB                                                                             0.0s
>  => [internal] load .dockerignore                                                                                  0.0s
>  => => transferring context: 2B                                                                                    0.0s
>  => [internal] load metadata for docker.io/dorowu/ubuntu-desktop-lxde-vnc:focal                                    1.2s
>  => [internal] load build context                                                                                  0.0s
>  => => transferring context: 91.34kB                                                                               0.0s
>  => [1/9] FROM docker.io/dorowu/ubuntu-desktop-lxde-vnc:focal@sha256:07e51eafb6e0923759105eeb8cfc8f0d19be77a212b1  0.0s
>  => CACHED [2/9] RUN echo "Set disable_coredump false" >> /etc/sudo.conf                                           0.0s
>  => ERROR [3/9] RUN apt-get update -q &&     apt-get upgrade -yq &&     apt-get install -yq         wget           3.6s
> ------
>  > [3/9] RUN apt-get update -q &&     apt-get upgrade -yq &&     apt-get install -yq         wget         curl         git         build-essential         vim         sudo         gnupg2         lsb-release         locales         bash-completion         tzdata         gosu         python3-argcomplete         python3-pip     && rm -rf /var/lib/apt/lists/*:
> #6 0.356 Get:1 http://dl.google.com/linux/chrome/deb stable InRelease [1811 B]
> #6 0.365 Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
> #6 0.370 Get:3 http://mirrors.ubuntu.com/mirrors.txt Mirrorlist [1061 B]
> #6 0.398 Get:5 http://ftp.nluug.nl/os/Linux/distr/ubuntu focal-updates InRelease [114 kB]
> #6 0.405 Get:4 http://nl.archive.ubuntu.com/ubuntu focal InRelease [265 kB]
> #6 0.411 Get:6 http://osmirror.rug.nl/ubuntu focal-backports InRelease [108 kB]
> #6 0.441 Err:1 http://dl.google.com/linux/chrome/deb stable InRelease
> #6 0.441   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B
> #6 0.513 Get:7 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2018 kB]
> #6 0.689 Get:9 https://mirrors.xtom.nl/ubuntu focal-backports/main amd64 Packages [54.2 kB]
> #6 0.735 Get:13 http://mirror.amsiohosting.net/archive.ubuntu.com focal/universe amd64 Packages [11.3 MB]
> #6 0.735 Get:8 http://mirror.serverius.net/ubuntu focal-backports/universe amd64 Packages [27.1 kB]
> #6 0.742 Get:14 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [883 kB]
> #6 0.752 Get:12 http://mirror.hostnet.nl/ubuntu/archive focal/main amd64 Packages [1275 kB]
> #6 0.806 Get:11 http://mirror.nforce.com/pub/linux/ubuntu focal/multiverse amd64 Packages [177 kB]
> #6 0.821 Get:10 http://mirror.eu.kamatera.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
> #6 0.857 Get:15 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [27.5 kB]
> #6 0.862 Get:16 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1386 kB]
> #6 0.959 Ign:18 https://nl.mirrors.clouvider.net/ubuntu focal-updates/multiverse amd64 Packages
> #6 1.316 Get:17 http://ftp.nluug.nl/os/Linux/distr/ubuntu focal-updates/universe amd64 Packages [1161 kB]
> #6 1.470 Get:20 http://ftp.tudelft.nl/archive.ubuntu.com focal-updates/main amd64 Packages [2456 kB]
> #6 1.584 Get:18 http://mirror.amsiohosting.net/archive.ubuntu.com focal-updates/multiverse amd64 Packages [30.2 kB]
> #6 1.896 Get:19 http://ftp.nluug.nl/os/Linux/distr/ubuntu focal-updates/restricted amd64 Packages [1487 kB]
> #6 2.882 Reading package lists...
> #6 3.469 W: GPG error: http://dl.google.com/linux/chrome/deb stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B
> #6 3.469 E: The repository 'http://dl.google.com/linux/chrome/deb stable InRelease' is not signed.
> ------
> executor failed running [/bin/sh -c apt-get update -q &&     apt-get upgrade -yq &&     apt-get install -yq         wget         curl         git         build-essential         vim         sudo         gnupg2         lsb-release         locales         bash-completion         tzdata         gosu         python3-argcomplete         python3-pip     && rm -rf /var/lib/apt/lists/*]: exit code: 100

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:5
  • Comments:7

github_iconTop GitHub Comments

10reactions
ecerveracommented, Jul 28, 2022

You have to add a line in the Dockerfile for getting the updated keys for Google Chrome:

...
ENV GROUP_NAME=ros
ENV WS_NAME=colcon_ws

RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -

RUN echo "Set disable_coredump false" >> /etc/sudo.conf
RUN apt-get update -q && \
...
2reactions
seifmostafa73commented, Aug 9, 2022

in case docker said that the RUN command is not found for the previous line, try RUN ["/bin/bash", "-c", "wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -"] it worked for me.

the full docker file (couldn’t make a pull request for it )

# adapted from: https://github.com/Tiryoh/docker-ros2-desktop-vnc
FROM dorowu/ubuntu-desktop-lxde-vnc:focal
LABEL maintainer="Unity Robotics <unity-robotics@unity3d.com>"

ENV DEBIAN_FRONTEND noninteractive
ENV DEV_NAME=rosdev
ENV ROS_DISTRO=galactic
ENV GROUP_NAME=ros
ENV WS_NAME=colcon_ws

RUN ["/bin/bash", "-c", "wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -"]

RUN echo "Set disable_coredump false" >> /etc/sudo.conf
RUN apt-get update -q && \
    apt-get upgrade -yq && \
    apt-get install -yq \
        wget \
        curl \
        git \
        build-essential \
        vim \
        sudo \
        gnupg2 \
        lsb-release \
        locales \
        bash-completion \
        tzdata \
        gosu \
        python3-argcomplete \
        python3-pip \
    && rm -rf /var/lib/apt/lists/*

# Install the immutable components BEFORE we copy in build context stuff to keep the rebuild process manageable
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 && \
    curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - && \
    echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > \
        /etc/apt/sources.list.d/ros2-latest.list && \
    apt-get update -q && \
    apt-get install -y --no-install-recommends \
      ros-${ROS_DISTRO}-ros-base \
      python3-rosdep \
      python3-colcon-common-extensions \
      python3-vcstool \
    && rm -rf /var/lib/apt/lists/* && rm /etc/apt/sources.list.d/ros2-latest.list

RUN useradd --create-home --home-dir /home/${DEV_NAME} --shell /bin/bash --user-group --groups adm,sudo ${DEV_NAME} && \
    echo "$DEV_NAME:$DEV_NAME" | chpasswd && \
    echo "$DEV_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
COPY --chown=${DEV_NAME} colcon_ws /home/${DEV_NAME}/colcon_ws
COPY ros2-setup.bash /bin/ros2-setup.bash
# Doing a second fetch of sources & apt-get update here, because these ones depend on the state of the build context
# in our repo
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 && \
    curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - && \
    echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > \
        /etc/apt/sources.list.d/ros2-latest.list && \
    apt-get update -q && \
    rosdep init && \
    chmod +x /bin/ros2-setup.bash && \
    gosu ${DEV_NAME} /bin/ros2-setup.bash && \
    runuser -u ${DEV_NAME} ros2-setup.bash && \
    rm /bin/ros2-setup.bash && \
    rm -rf /var/lib/apt/lists/* && rm /etc/apt/sources.list.d/ros2-latest.list

RUN echo ". /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/${DEV_NAME}/.bashrc && \
    echo ". /home/${DEV_NAME}/${WS_NAME}/install/local_setup.bash" >> /home/${DEV_NAME}/.bashrc

ENV TURTLEBOT3_MODEL=waffle_pi

# To bring up tb3 simulation example (from https://navigation.ros.org/tutorials/docs/navigation2_with_slam.html)
# cd catkin_ws && source install/setup.bash && ros2 launch nav2_bringup tb3_simulation_launch.py slam:=True

# Informs the environment that the default user is not root, but instead DEV_NAME
ENV USER ${DEV_NAME}


Read more comments on GitHub >

github_iconTop Results From Across the Web

GPG error while building docker · Issue #7951 - GitHub
I encountered same problem. git clone https://github.com/open-mmlab/mmdetection.git -b v2.24.1 cd mmdetection/docker docker build - ...
Read more >
Troubleshoot "Expired GPG key" Error in Build - CircleCI Support
If you are using a CircleCI pre-built Docker Image and are getting an "Expired GPG key" error in your build. You can resolve...
Read more >
How to resolve GPG error when starting PHP docker container?
When I run docker build php-fpm this error is thrown: Sending build context to Docker daemon 3.584kB Step 1/10 : FROM php:7.0.23-fpm ...
Read more >
GPG and Signing Error during apt install phase of a docker ...
I am going to try to add the repos GPG keys at the beginning of the build, see if that helps.
Read more >
GPG error in Ubuntu 21.04 after second apt-get update during ...
I ran into this problem when I was running the Ubuntu 21.04 image under Rootless Docker, but the apt-get update command worked fine...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found