f1tenth / f1tenth_gym_ros

Containerized ROS communication bridge for F1TENTH gym environment.
MIT License
154 stars 106 forks source link

Unable to build Docker Images due to Expired GPG Keys of snapshots.ros.org #38

Open Rawwad-Alhejaili opened 9 months ago

Rawwad-Alhejaili commented 9 months ago

Describe the bug Cannot build the docker image (with support for Nvidia GPUs) due to the expiry of the GPG key of snapshots.ros.org. Specifically, the docker image is unable to download ros-foxy-rviz2 due to the GPG key being expired.

To Reproduce The bug occurs when building the docker image. I will include the steps to reproduce the error here:

  1. Clone this repo (f1tenth_gym_os).
  2. Build the docker image by:
    $ cd f1tenth_gym_ros
    $ docker build -t f1tenth_gym_ros -f Dockerfile # the error occurs here.

Expected behavior The docker image should be able to download ros-foxy-rviz2.

Fix This issue has already been addressed by Open Ropotics. It can be solved by adding the following line to Dockerfile before downloading ros-foxy-rviz2.

RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B63CF8FDE49746E98FA01DDAD19BAB3CBF125EA

Dockerfile currently

FROM ros:foxy

SHELL ["/bin/bash", "-c"]

# dependencies
RUN apt-get update --fix-missing && \
    apt-get install -y git \
                       nano \
                       vim \
                       python3-pip \
                       libeigen3-dev \
                       tmux \
                       ros-foxy-rviz2
RUN apt-get -y dist-upgrade
RUN pip3 install transforms3d

# f1tenth gym
RUN git clone https://github.com/f1tenth/f1tenth_gym
RUN cd f1tenth_gym && \
    pip3 install -e .

# ros2 gym bridge
RUN mkdir -p sim_ws/src/f1tenth_gym_ros
COPY . /sim_ws/src/f1tenth_gym_ros
RUN source /opt/ros/foxy/setup.bash && \
    cd sim_ws/ && \
    apt-get update --fix-missing && \
    rosdep install -i --from-path src --rosdistro foxy -y && \
    colcon build

WORKDIR '/sim_ws'
ENTRYPOINT ["/bin/bash"]

After fixing Dockerfile

FROM ros:foxy

SHELL ["/bin/bash", "-c"]

# dependencies
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 4B63CF8FDE49746E98FA01DDAD19BAB3CBF125EA #GPG Key FIX
RUN apt-get update --fix-missing && \
    apt-get install -y git \
                       nano \
                       vim \
                       python3-pip \
                       libeigen3-dev \
                       tmux \
                       ros-foxy-rviz2
RUN apt-get -y dist-upgrade
RUN pip3 install transforms3d

# f1tenth gym
RUN git clone https://github.com/f1tenth/f1tenth_gym
RUN cd f1tenth_gym && \
    pip3 install -e .

# ros2 gym bridge
RUN mkdir -p sim_ws/src/f1tenth_gym_ros
COPY . /sim_ws/src/f1tenth_gym_ros
RUN source /opt/ros/foxy/setup.bash && \
    cd sim_ws/ && \
    apt-get update --fix-missing && \
    rosdep install -i --from-path src --rosdistro foxy -y && \
    colcon build

WORKDIR '/sim_ws'
ENTRYPOINT ["/bin/bash"]
mikaelarguedas commented 9 months ago

FYI the ROS images on dockerhub have been rebuilt with the updated GPG key.

More details at https://github.com/osrf/docker_images/issues/697#issuecomment-1856463789