From e3f484edb49e0ad500bcaab04c16f53c61886b5d Mon Sep 17 00:00:00 2001 From: bjoernellens1 <64093272+bjoernellens1@users.noreply.github.com> Date: Wed, 9 Aug 2023 08:35:45 +0200 Subject: [PATCH] Update Dockerfile Splitting in more layers. Rearranging --- docker/Dockerfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index c45d5f9..aea6292 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -45,8 +45,9 @@ WORKDIR /rmp_ws RUN source /opt/ros/${ROS_DISTRO}/setup.bash \ && apt-get update -y \ && rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y \ - && colcon build --symlink-install \ - && rm -rf /var/lib/apt/lists/* + +RUN source /opt/ros/${ROS_DISTRO}/setup.bash \ + && colcon build --symlink-install # Use Cyclone DDS as middleware RUN apt-get update && apt-get install -y --no-install-recommends \ @@ -72,11 +73,14 @@ RUN vcs import < overlay.repos WORKDIR /overlay_ws RUN source /rmp_ws/install/setup.bash \ - && colcon build --symlink-install \ && apt-get update \ && rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y \ && rm -rf /var/lib/apt/lists/* + +RUN source /rmp_ws/install/setup.bash \ + && colcon build --symlink-install + # Set up the entrypoint COPY ./docker/entrypoint.sh / RUN chmod +x /entrypoint.sh @@ -96,13 +100,15 @@ FROM overlay AS guis # Install additional GUI tools RUN source /rmp_ws/install/setup.bash \ - && colcon build --symlink-install \ && apt-get update \ && apt-get install -y --no-install-recommends ros-${ROS_DISTRO}-rviz2 \ && rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y \ && rm -rf /var/lib/apt/lists/* +RUN source /rmp_ws/install/setup.bash \ + && colcon build --symlink-install \ + # Set up the entrypoint ENTRYPOINT [ "/entrypoint.sh" ] -LABEL org.opencontainers.image.source=https://github.com/bjoernellens1/ros2_rmp \ No newline at end of file +LABEL org.opencontainers.image.source=https://github.com/bjoernellens1/ros2_rmp