27 lines
597 B
Docker
27 lines
597 B
Docker
|
# Use ROS 2 Humble Hawksbill base image
|
||
|
FROM osrf/ros:humble-desktop-full
|
||
|
|
||
|
# Update and install dependencies
|
||
|
RUN apt-get update && apt-get install -y \
|
||
|
python3-colcon-common-extensions \
|
||
|
&& rm -rf /var/lib/apt/lists/*
|
||
|
|
||
|
COPY requirements.txt ./
|
||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||
|
|
||
|
# Create a workspace
|
||
|
WORKDIR /ros2_ws
|
||
|
|
||
|
# Copy your ROS 2 package into the workspace
|
||
|
COPY ./ros2_ws/src /ros2_ws/src
|
||
|
|
||
|
# Build your package
|
||
|
RUN . /opt/ros/humble/setup.sh && \
|
||
|
colcon build
|
||
|
|
||
|
RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
|
||
|
|
||
|
|
||
|
# Source the workspace
|
||
|
CMD ["/bin/bash"]
|