InteractiveRobotLearning/Dockerfile

29 lines
695 B
Docker
Raw Normal View History

2024-02-14 11:16:31 +00:00
# Use ROS 2 Humble Hawksbill base image
2024-02-15 11:04:54 +00:00
FROM osrf/ros:humble-desktop-full-jammy
2024-02-14 11:16:31 +00:00
# Update and install dependencies
RUN apt-get update && apt-get install -y \
2024-02-29 13:37:36 +00:00
python3-colcon-common-extensions python3-pip
2024-02-14 11:16:31 +00:00
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
2024-02-29 13:37:36 +00:00
RUN rm -rf /var/lib/apt/lists/*
2024-02-14 11:16:31 +00:00
# Create a workspace
WORKDIR /ros2_ws
# Copy your ROS 2 package into the workspace
2024-02-15 11:04:54 +00:00
COPY ./src /ros2_ws/src
2024-02-14 11:16:31 +00:00
# Build your package
RUN . /opt/ros/humble/setup.sh && \
colcon build
RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
2024-02-29 13:37:36 +00:00
ENV PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/ros/humble/bin"
2024-02-14 11:16:31 +00:00
# Source the workspace
CMD ["/bin/bash"]