Sraghvi's picture
Upload bimanual bone packing dataset with so101 folder structure
da5a206 verified
raw
history blame
2.67 kB
# Base image that builds all packages
FROM ros:humble-ros-core AS base-builder
# Set environment variables
ENV ROS_DISTRO=humble
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
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/*
# Create workspace
WORKDIR /workspace
# Copy the entire workspace
COPY ros_ws/src/ /workspace/src/
# Build all packages
RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \
colcon build
# Create base runtime image with sidecar infrastructure
FROM ros:humble-ros-core AS base-runtime
# Set environment variables
ENV ROS_DISTRO=humble
ENV DEBIAN_FRONTEND=noninteractive
# Install runtime dependencies + Python for sidecar
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 the entire install directory from builder stage
COPY --from=base-builder /workspace/install /opt/ros/${ROS_DISTRO}/install
# Install Python dependencies for sidecar infrastructure
COPY orchestration/sidecar/requirements.txt /app/
RUN pip3 install --no-cache-dir -r /app/requirements.txt
# Copy sidecar application (available to all components)
COPY orchestration/sidecar/sidecar_app.py /app/
# Create standard directories
RUN mkdir -p /app/logs /bags
# Set up common entrypoint
COPY ros_ws/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# Create non-root user for components
RUN groupadd -r robotics && useradd -r -g robotics robotics
# Create ROS2 logging directory for robotics user
RUN mkdir -p /home/robotics/.ros/log
RUN chown -R robotics:robotics /app /bags /usr/local/bin/entrypoint.sh /home/robotics
# Health check for base infrastructure
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD ros2 --version && python3 -c "import requests; print('Base infrastructure healthy')" || exit 1
# Switch to non-root user
USER robotics
ENTRYPOINT ["entrypoint.sh"]