mirror of
https://github.com/bjoernellens1/ros2_bot_mini.git
synced 2024-11-24 22:35:10 +00:00
53 lines
1.6 KiB
Docker
53 lines
1.6 KiB
Docker
|
ARG ROS_DISTRO=humble
|
||
|
ARG UNDERLAY_WS=/bot_mini_ws
|
||
|
|
||
|
########################################
|
||
|
# Base Image for Bot Mini Control #
|
||
|
########################################
|
||
|
FROM osrf/ros:${ROS_DISTRO}-desktop as base
|
||
|
ENV ROS_DISTRO=${ROS_DISTRO}
|
||
|
SHELL ["/bin/bash", "-c"]
|
||
|
|
||
|
# Create Colcon workspace with external dependencies
|
||
|
RUN mkdir -p /bot_mini_ws/src
|
||
|
WORKDIR /bot_mini_ws/src
|
||
|
COPY dependencies.repos .
|
||
|
RUN vcs import < dependencies.repos
|
||
|
|
||
|
# Build the base Colcon workspace, installing dependencies first.
|
||
|
WORKDIR /bot_mini_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
|
||
|
|
||
|
# Use Cyclone DDS as middleware
|
||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||
|
ros-${ROS_DISTRO}-rmw-cyclonedds-cpp
|
||
|
ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
|
||
|
|
||
|
ENV UNDERLAY_WS=${UNDERLAY_WS}
|
||
|
|
||
|
###########################################
|
||
|
# Overlay Image for Bot Mini Control #
|
||
|
###########################################
|
||
|
FROM base AS overlay
|
||
|
|
||
|
# Create an overlay Colcon workspace
|
||
|
RUN mkdir -p /overlay_ws/src
|
||
|
WORKDIR /overlay_ws/src
|
||
|
COPY overlay.repos .
|
||
|
RUN vcs import < overlay.repos
|
||
|
|
||
|
WORKDIR /overlay_ws
|
||
|
# COPY ./tb3_autonomy/ ./src/tb3_autonomy/
|
||
|
# COPY ./tb3_worlds/ ./src/tb3_worlds/
|
||
|
RUN source /bot_mini_ws/install/setup.bash \
|
||
|
&& colcon build --symlink-install \
|
||
|
&& rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y
|
||
|
|
||
|
# Set up the entrypoint
|
||
|
COPY ./docker/entrypoint.sh /
|
||
|
RUN chmod +x /entrypoint.sh
|
||
|
|
||
|
ENTRYPOINT [ "/entrypoint.sh" ]
|