-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (17 loc) · 809 Bytes
/
Dockerfile
File metadata and controls
23 lines (17 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Use the official ROS 2 Dashing image as the base
FROM ros:dashing
# Set the working directory inside the container
WORKDIR /ros2_ws
# Set bash as the default shell and enable executing chained commands
SHELL ["/bin/bash", "-c"]
# Install essential ROS 2 development tools
# python3-colcon-common-extensions is needed for building packages
RUN apt-get update && apt-get install -y \
python3-colcon-common-extensions \
&& rm -rf /var/lib/apt/lists/*
# Automatically source ROS 2 setup script for interactive shells
RUN echo "source /opt/ros/dashing/setup.bash" >> ~/.bashrc
# Optionally, copy local source code during build (comment out if using volumes primarily)
# COPY ./ros2_ws/src /ros2_ws/src
# Default command to run when the container starts (provides an interactive shell)
CMD ["bash"]