Robotics-Nav2-SLAM-Example icon indicating copy to clipboard operation
Robotics-Nav2-SLAM-Example copied to clipboard

ERROR keyserver 'hkp://keyserver.ubuntu.com:80'

Open alex77272 opened this issue 1 year ago • 1 comments

Hello,

I just can't build the docker and always get the following error:

0.255 Executing: /tmp/apt-key-gpghome.h5zo4KlEsf/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 0.457 gpg: CRC error; 14C720 - 6C9712 0.457 gpg: read_block: read error: Invalid keyring 0.457 gpg: Total number processed: 0

Anyone has a tip how I can solve it?

Tried to build on a Mac and also on Ubuntu 22.04..

alex77272 avatar Feb 08 '24 18:02 alex77272

for me

  1. first change DockerFile to the following:
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 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 curl http://repo.ros2.org/repos.key | sudo apt-key add -
RUN 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}-desktop \
      python3-rosdep \
      python3-colcon-common-extensions \
      python3-vcstool \
      ros-galactic-navigation2 \
      ros-galactic-nav2-bringup \
    && 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 curl http://repo.ros2.org/repos.key | sudo apt-key add -
RUN 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}
  1. if encounter problem like " Failed to connect to raw.githubusercontent.com ", ensure your local network can visit https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc, otherwise your have to modify your local network, like hosts or VPN, for me, i use VPN and change hosts at docker build command: docker build --add-host=raw.githubusercontent.com:185.199.110.133 -t unity-robotic:nav2-slam-example ./ change the host ip depends on your network.

875353581 avatar Mar 07 '24 02:03 875353581