docker build runs into GPG error
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
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 && \
...
Shouldn't this be a Pull Request?
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 <[email protected]>"
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}
Hi,I have followed your advice and add the line to the Dockerfile:
But I still get this error:
so how can I solve it?looking forward to your reply
Hi,I have followed your advice and add the line to the Dockerfile:
But I still get this error:
so how can I solve it?looking forward to your reply
Update:Everything works fine after I change the source to tuna mirror:

Hi,I have followed your advice and add the line to the Dockerfile:
But I still get this error:
so how can I solve it?looking forward to your reply
Update:Everything works fine after I change the source to tuna mirror:
Unfortunatly it still gives an error at the end, and I searched all over google and can't find a workable solution, can anyone help me to get rid of this annoying error:

Hi,I have followed your advice and add the line to the Dockerfile:
But I still get this error:
so how can I solve it?looking forward to your reply
Update:Everything works fine after I change the source to tuna mirror:
Unfortunatly it still gives an error at the end, and I searched all over google and can't find a workable solution, can anyone help me to get rid of this annoying error:
Update:After many attempts, I finally successfully built the image, I guess this should be due to wsl2 and docker complex network problems, but anyway,I eventually solved this annoying error:

Hi,I have followed your advice and add the line to the Dockerfile:
But I still get this error:
so how can I solve it?looking forward to your reply
Update:Everything works fine after I change the source to tuna mirror:
Unfortunatly it still gives an error at the end, and I searched all over google and can't find a workable solution, can anyone help me to get rid of this annoying error:
Update:After many attempts, I finally successfully built the image, I guess this should be due to wsl2 and docker complex network problems, but anyway,I eventually solved this annoying error:
I have encountered the same problem as you. Can I attach your final dockerfile