|
|
|
|
|
FROM ros:humble-ros-core AS base-builder |
|
|
|
|
|
|
|
|
ENV ROS_DISTRO=humble |
|
|
ENV DEBIAN_FRONTEND=noninteractive |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
build-essential \ |
|
|
cmake \ |
|
|
git \ |
|
|
python3-colcon-common-extensions \ |
|
|
python3-catkin-pkg \ |
|
|
python3-rosdep \ |
|
|
ros-${ROS_DISTRO}-rclcpp \ |
|
|
ros-${ROS_DISTRO}-control-msgs \ |
|
|
ros-${ROS_DISTRO}-std-msgs \ |
|
|
ros-${ROS_DISTRO}-sensor-msgs \ |
|
|
ros-${ROS_DISTRO}-rosbag2-cpp \ |
|
|
ros-${ROS_DISTRO}-rosidl-runtime-cpp \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
WORKDIR /workspace |
|
|
|
|
|
|
|
|
COPY ros_ws/src/ /workspace/src/ |
|
|
|
|
|
|
|
|
RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \ |
|
|
colcon build |
|
|
|
|
|
|
|
|
FROM ros:humble-ros-core AS base-runtime |
|
|
|
|
|
|
|
|
ENV ROS_DISTRO=humble |
|
|
ENV DEBIAN_FRONTEND=noninteractive |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
|
ros-${ROS_DISTRO}-rclcpp \ |
|
|
ros-${ROS_DISTRO}-control-msgs \ |
|
|
ros-${ROS_DISTRO}-std-msgs \ |
|
|
ros-${ROS_DISTRO}-sensor-msgs \ |
|
|
ros-${ROS_DISTRO}-rosbag2-cpp \ |
|
|
ros-${ROS_DISTRO}-rosidl-runtime-cpp \ |
|
|
ros-${ROS_DISTRO}-rosbag2-storage-default-plugins \ |
|
|
ros-${ROS_DISTRO}-rmw-fastrtps-cpp \ |
|
|
ros-${ROS_DISTRO}-rmw-implementation \ |
|
|
python3 \ |
|
|
python3-pip \ |
|
|
curl \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
COPY --from=base-builder /workspace/install /opt/ros/${ROS_DISTRO}/install |
|
|
|
|
|
|
|
|
COPY orchestration/sidecar/requirements.txt /app/ |
|
|
RUN pip3 install --no-cache-dir -r /app/requirements.txt |
|
|
|
|
|
|
|
|
COPY orchestration/sidecar/sidecar_app.py /app/ |
|
|
|
|
|
|
|
|
RUN mkdir -p /app/logs /bags |
|
|
|
|
|
|
|
|
COPY ros_ws/docker/entrypoint.sh /usr/local/bin/entrypoint.sh |
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh |
|
|
|
|
|
|
|
|
RUN groupadd -r robotics && useradd -r -g robotics robotics |
|
|
|
|
|
|
|
|
RUN mkdir -p /home/robotics/.ros/log |
|
|
RUN chown -R robotics:robotics /app /bags /usr/local/bin/entrypoint.sh /home/robotics |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ |
|
|
CMD ros2 --version && python3 -c "import requests; print('Base infrastructure healthy')" || exit 1 |
|
|
|
|
|
|
|
|
USER robotics |
|
|
|
|
|
ENTRYPOINT ["entrypoint.sh"] |
|
|
|