1+ # Dockerfile for ROSCon 2024 Deliberation Workshop
2+
3+ FROM ros:humble AS robocup2024
4+ SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
5+
6+ # Install apt dependencies.
7+ ARG DEBIAN_FRONTEND=noninteractive
8+ # RUN apt-get update && \
9+ # apt-get upgrade -y && \
10+ # apt-get install -y \
11+ # gcc \
12+ # git \
13+ # wget \
14+ # python3 nlohmann-json3-dev python3-pip portaudio19-dev \
15+ # ros-humble-moveit
16+ RUN apt-get update \
17+ && apt-get -y --quiet --no-install-recommends install \
18+ gcc \
19+ git \
20+ wget \
21+ portaudio19-dev \
22+ python3 \
23+ python3-pip \
24+ ros-humble-moveit \
25+ nlohmann-json3-dev
26+
27+
28+ # Create a ROS 2 workspace.
29+ RUN mkdir -p /robocup/src/
30+ WORKDIR /robocup
31+
32+ ADD https://raw.githubusercontent.com/mgonzs13/audio_common/refs/heads/main/requirements.txt /robocup/requirements1.txt
33+ ADD https://raw.githubusercontent.com/mgonzs13/whisper_ros/refs/heads/main/requirements.txt /robocup/requirements2.txt
34+ ADD https://raw.githubusercontent.com/mgonzs13/llama_ros/refs/heads/main/requirements.txt /robocup/requirements3.txt
35+ ADD https://raw.githubusercontent.com/jmguerreroh/yolov8_ros/refs/heads/main/requirements.txt /robocup/requirements4.txt
36+ ADD https://raw.githubusercontent.com/mgonzs13/tts_ros/refs/heads/main/requirements.txt /robocup/requirements5.txt
37+
38+ # Install external dependencies.
39+ RUN pip install -r requirements1.txt
40+ RUN pip install -r requirements2.txt
41+ RUN pip install -r requirements3.txt
42+ RUN pip install -r requirements4.txt
43+ RUN pip install -r requirements5.txt
44+
45+
46+ WORKDIR /robocup/src
47+ RUN git clone https://github.com/juandpenan/CoreSense4Home.git -b humble-devel
48+ RUN vcs import --recursive < ./CoreSense4Home/robocup_bringup/thirdparty.repos
49+
50+ WORKDIR /robocup
51+ RUN rosdep install --from-paths src --ignore-src -r -y
52+
53+ # Remove MatPlotLib display warnings.
54+ RUN mkdir /tmp/runtime-root
55+ ENV XDG_RUNTIME_DIR "/tmp/runtime-root"
56+ RUN chmod -R 0700 /tmp/runtime-root
57+ ENV NO_AT_BRIDGE 1
58+
59+ # Set up the entrypoint.
60+ # Install CUDA nvcc
61+ ARG USE_CUDA
62+ ARG CUDA_VERSION=12-6
63+
64+ RUN if [ "$USE_CUDA" = "1" ]; then \
65+ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.1-1_all.deb && \
66+ dpkg -i cuda-keyring_1.1-1_all.deb && \
67+ rm cuda-keyring_1.1-1_all.deb; \
68+ apt-get update && apt-get install -y cuda-toolkit-$CUDA_VERSION; \
69+ echo "export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}" >> ~/.bashrc; \
70+ echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" >> ~/.bashrc; \
71+ fi
72+
73+ # Install gdp grasp generator library
74+ WORKDIR /robocup/src/ThirdParty/gpd
75+ RUN mkdir build
76+ WORKDIR /robocup/src/ThirdParty/gpd/build
77+ RUN cmake ..
78+ RUN make -j
79+ RUN make install
80+
81+ # Colcon the ws
82+ WORKDIR /robocup
83+ FROM robocup2024 AS builder
84+ ARG CMAKE_BUILD_TYPE=Release
85+
86+ ENV PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
87+ ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64
88+
89+ RUN source /opt/ros/${ROS_DISTRO}/setup.bash && \
90+ if [ "$USE_CUDA" = "1" ]; then \
91+ source ~/.bashrc && \
92+ colcon build --packages-skip tts_bringup --cmake-args -DGGML_CUDA=ON; \
93+ else \
94+ colcon build --packages-skip tts_bringup; \
95+ fi
96+
97+ # Source the ROS 2 setup file
98+ RUN echo "source /root/robocup/install/setup.bash" >> ~/.bashrc
99+
100+ # Run a default command, e.g., starting a bash shell
101+ CMD ["bash" ]
0 commit comments