Update Dockerfile

Splitting in more layers. Rearranging
This commit is contained in:
bjoernellens1 2023-08-09 08:35:45 +02:00 committed by GitHub
parent 958a0c70ef
commit e3f484edb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
LABEL org.opencontainers.image.source=https://github.com/bjoernellens1/ros2_rmp