-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (24 loc) · 772 Bytes
/
Dockerfile
File metadata and controls
31 lines (24 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM osrf/ros:humble-desktop
# Avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt update && apt install -y \
ros-humble-nav2-bringup \
ros-humble-slam-toolbox \
ros-humble-gazebo-ros-pkgs \
ros-humble-ros2-control \
ros-humble-ros2-controllers \
ros-humble-controller-manager \
python3-colcon-common-extensions \
&& rm -rf /var/lib/apt/lists/*
# Create workspace
WORKDIR /ros2_ws
# Copy your project
COPY . /ros2_ws/src/diff_robot
# Build workspace
RUN /bin/bash -c "source /opt/ros/humble/setup.bash && colcon build"
# Source ROS automatically
RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
RUN echo "source /ros2_ws/install/setup.bash" >> ~/.bashrc
# Default command
CMD ["bash"]