@@ -40,10 +40,33 @@ ARG GIT_REPO_VERSION_DATE="unknown"
4040ENV GIT_REPO_VERSION=${GIT_REPO_VERSION}
4141ENV GIT_REPO_VERSION_DATE=${GIT_REPO_VERSION_DATE}
4242
43- RUN mkdir -p /root/workspace/src
44- COPY . /root/workspace/src/repository
45- WORKDIR /root/workspace/
43+ # Install CycloneDDS ROS middleware implementation
44+ RUN apt-get update \
45+ && apt-get install -qq -y --no-install-recommends \
46+ ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \
47+ && rm -rf /var/lib/apt/lists/*
48+
49+ # Install additional Python packages required by the application
50+ COPY src/rosbag_blackbox/requirements.txt /tmp/requirements.txt
51+ RUN pip3 install --no-cache-dir -r /tmp/requirements.txt && rm /tmp/requirements.txt
52+
53+ # Use CycloneDDS as the default ROS Middleware
54+ ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
55+
56+ # Path to the colcon workspace inside the container
57+ ENV WORKSPACE_DIR=/root/workspace
58+
59+ RUN mkdir -p ${WORKSPACE_DIR}/src
60+ COPY . ${WORKSPACE_DIR}/src/repository
61+ WORKDIR ${WORKSPACE_DIR}
4662RUN rosdep update --rosdistro ${ROS_DISTRO} && apt-get update \
4763 && rosdep install --from-paths ./src --ignore-src -r -y \
48- && bash -c "source /opt/ros/${ROS_DISTRO}/setup.sh; colcon build"
64+ && bash -c "source /opt/ros/${ROS_DISTRO}/setup.sh; colcon build" \
65+ && rm -rf /var/lib/apt/lists/*
66+
67+ COPY entrypoint.sh /entrypoint.sh
68+ RUN chmod +x /entrypoint.sh
69+
70+ ENTRYPOINT ["/entrypoint.sh" ]
71+ CMD ["ros2" , "launch" , "rosbag_blackbox" , "rosbag_blackbox.launch.py" ]
4972
0 commit comments