|
1 | | -# Ubuntu 24.04 |
2 | | -FROM osrf/ros:jazzy-desktop-full AS vrx-base |
| 1 | +# Ubuntu 24.04 |
| 2 | +FROM ros:jazzy-ros-base AS vrx-base |
3 | 3 |
|
4 | 4 | # Workaround from https://discourse.ros.org/t/ros-signing-key-migration-guide/43937 |
5 | 5 | RUN rm -f /etc/apt/sources.list.d/ros2-latest.list \ |
@@ -31,9 +31,51 @@ RUN echo $TZ > /etc/timezone && \ |
31 | 31 | RUN curl -s https://packages.osrfoundation.org/gazebo.gpg -o /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg && \ |
32 | 32 | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null |
33 | 33 |
|
34 | | -# Install some 'standard' ROS packages and utilities. |
| 34 | +# Install gz-harmonic |
35 | 35 | RUN apt update \ |
36 | 36 | && apt install -y --no-install-recommends \ |
37 | 37 | gz-harmonic \ |
| 38 | + equivs \ |
38 | 39 | && rm -rf /var/lib/apt/lists/* \ |
39 | 40 | && apt clean -qq |
| 41 | + |
| 42 | +# Solution for problem https://github.com/osrf/vrx/issues/839 |
| 43 | +# Create fake providers for the ROS Gazebo vendor packages of the Gz libraries |
| 44 | +# that support Python bindings and use a colcon workspace to inject |
| 45 | +# the real ROS packages. |
| 46 | + |
| 47 | +# Create the dummy package control file for ROS Jazzy Gazebo vendor packages |
| 48 | +COPY <<EOF /tmp/fake-ros-jazzy-gz-vendor |
| 49 | +Package: fake-ros-jazzy-gz-vendor |
| 50 | +Version: 999.999 |
| 51 | +Architecture: all |
| 52 | +Description: Fake ROS Jazzy Gazebo vendor packages for containers |
| 53 | + This package provides dummy implementations to satisfy |
| 54 | + ROS Jazzy Gazebo vendor package dependencies without actual functionality. |
| 55 | +Provides: ros-jazzy-gz-math-vendor, ros-jazzy-gz-msgs-vendor, ros-jazzy-gz-transport-vendor, ros-jazzy-gz-sim-vendor, ros-jazzy-sdformat-vendor |
| 56 | +EOF |
| 57 | + |
| 58 | +# Build and install the dummy package |
| 59 | +RUN cd /tmp \ |
| 60 | + && cat fake-ros-jazzy-gz-vendor \ |
| 61 | + && equivs-build fake-ros-jazzy-gz-vendor \ |
| 62 | + && dpkg -i fake-ros-jazzy-gz-vendor_*_all.deb \ |
| 63 | + && rm -f /tmp/fake-ros-jazzy-gz-vendor /tmp/fake-ros-jazzy-gz-vendor_*_all.deb |
| 64 | + |
| 65 | +ADD gz.repos /tmp/gz.repos |
| 66 | + |
| 67 | +RUN mkdir -p /opt/ros_gz_ws/src \ |
| 68 | + && cd /opt/ros_gz_ws \ |
| 69 | + && vcs import src < /tmp/gz.repos \ |
| 70 | + && apt update \ |
| 71 | + && rosdep install -r --from-paths . --ignore-src --rosdistro jazzy -y --skip-keys="gz_math_vendor gz_msgs_vendor gz_sim_vendor gz_transport_vendor sdformat_vendor" \ |
| 72 | + && . /opt/ros/jazzy/setup.sh \ |
| 73 | + && colcon build --merge-install --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release |
| 74 | + |
| 75 | +# Source for interactive shells (both login and non-login) |
| 76 | +RUN echo "source /opt/ros_gz_ws/install/setup.bash" > /etc/profile.d/ros_gz_pythons.sh \ |
| 77 | + && echo "export GZ_CONFIG_PATH=\$GZ_CONFIG_PATH:/usr/share/gz/" > /etc/profile.d/ros_gz_pythons.sh \ |
| 78 | + && chmod +x /etc/profile.d/ros_gz_pythons.sh \ |
| 79 | + && echo "source /etc/profile.d/ros_gz_pythons.sh" >> /etc/bash.bashrc |
| 80 | +# Source for non-interactive shells |
| 81 | +ENV BASH_ENV=/etc/profile.d/ros_gz_pythons.sh |
0 commit comments