1+ # Use the official ROS 2 Humble base image with Gazebo Fortress pre-installed
2+ FROM osrf/ros:humble-desktop-full
3+
4+ # Set environment variables for non-interactive installation
5+ ENV DEBIAN_FRONTEND=noninteractive
6+
7+ ENV WORKSPACE_DIR=/kaslab_robocup_ws
8+
9+ # Update and install additional dependencies if needed
10+ RUN apt-get update && apt-get install -y \
11+ ros-humble-gazebo-ros-pkgs \
12+ python3-vcstool \
13+ python3-rosdep \
14+ ignition-fortress \
15+ vim \
16+ && rm -rf /var/lib/apt/lists/*
17+
18+ # Create workspace directories
19+ RUN mkdir -p $WORKSPACE_DIR/src
20+
21+ # Copy dependencies.repos into the container
22+ COPY general_dependencies.repos $WORKSPACE_DIR/
23+ COPY mirte_dependencies.repos $WORKSPACE_DIR/
24+
25+ # Use vcs to import and clone all packages
26+ RUN git clone -b fortress https://github.com/kas-lab/robocup_home_simulation.git $WORKSPACE_DIR/src/robocup_home_simulation
27+ RUN vcs import $WORKSPACE_DIR/src < $WORKSPACE_DIR/general_dependencies.repos
28+ RUN vcs import $WORKSPACE_DIR/src < $WORKSPACE_DIR/mirte_dependencies.repos
29+ RUN rm -f $WORKSPACE_DIR/*.repos
30+ RUN touch $WORKSPACE_DIR/src/mirte-ros-packages/mirte_telemetrix_cpp/COLCON_IGNORE
31+
32+ # Initialize rosdep
33+ # RUN rosdep update && apt update
34+
35+ # Source ROS 2 setup script, install dependencies, and build the workspace
36+ WORKDIR $WORKSPACE_DIR
37+ # RUN /bin/bash -c "source /opt/ros/humble/setup.bash && \
38+ # rosdep install --from-paths src --ignore-src -r -y"
39+
40+ RUN ["/bin/bash" , "-c" , "source /opt/ros/humble/setup.bash \
41+ && apt update \
42+ && rosdep update \
43+ && rosdep install --from-paths src --ignore-src -r -y \
44+ && sudo rm -rf /var/lib/apt/lists/" ]
45+
46+ RUN /bin/bash -c "source /opt/ros/humble/setup.bash && \
47+ colcon build --symlink-install"
48+
49+ # RUN rm -rf /var/lib/apt/lists/*
50+
51+ # Set the default entrypoint
52+ ENTRYPOINT ["/bin/bash" ]
0 commit comments