From 272b51e250bf56594b04a47a00dcb0e461d7942a Mon Sep 17 00:00:00 2001 From: bjoernellens1 <64093272+bjoernellens1@users.noreply.github.com> Date: Mon, 23 Oct 2023 14:16:57 +0200 Subject: [PATCH] Update my_example.Dockerfile --- docker/my_example.Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/my_example.Dockerfile b/docker/my_example.Dockerfile index b204275..61a963c 100644 --- a/docker/my_example.Dockerfile +++ b/docker/my_example.Dockerfile @@ -12,6 +12,7 @@ FROM osrf/ros:${ROS_DISTRO}-desktop as base SHELL ["/bin/bash", "-c"] # change shell to bash because of better compatibility (standard shell would be sh otherwise). # Create Colcon workspace with external dependencies +# This step sources our external repositories from the internet RUN mkdir -p /base_ws/src WORKDIR /base_ws/src COPY my.repos . @@ -20,12 +21,13 @@ RUN vcs import < dependencies.repos # Build the base Colcon workspace, installing dependencies first. WORKDIR /base_ws +# Wherever possible, install packages from apt instead of compiling from source. This is faster and more reliable. RUN source /opt/ros/${ROS_DISTRO}/setup.bash \ && apt-get update -y \ && apt-get install -y --no-install-recommends \ ros-${ROS_DISTRO}-turtlesim \ ros-${ROS_DISTRO}-rqt \ - && rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y + && rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y #This makes sure all dependencies are installed for our external sources. RUN source /opt/ros/${ROS_DISTRO}/setup.bash \ && colcon build --symlink-install