-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (27 loc) · 845 Bytes
/
Dockerfile
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
32
33
34
35
FROM osrf/ros:humble-desktop
# Update and install required packages
RUN apt-get update && apt-get install -y \
python3-rosdep \
python3-rosinstall \
python3-rosinstall-generator \
python3-wstool \
build-essential
# Initialize rosdep
RUN if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then \
rosdep init; \
fi && \
rosdep update
# Create a workspace and clone your project
RUN mkdir -p /ros_ws/src
COPY . /ros_ws/src
# install dependencies
RUN /bin/bash -c "source /opt/ros/humble/setup.bash && \
cd /ros_ws && \
rosdep install --from-paths src --ignore-src -r -y"
# Build the workspace
RUN /bin/bash -c "source /opt/ros/humble/setup.bash && \
cd /ros_ws && \
colcon build"
# Source the workspace
RUN echo "source /ros_ws/install/setup.bash" >> ~/.bashrc
CMD ["bash"]