22 lines
592 B
Docker
22 lines
592 B
Docker
FROM ros:jazzy
|
|
|
|
# Create the workspace and copy all source directories into it
|
|
WORKDIR /ros2_ws
|
|
COPY . /ros2_ws/src/
|
|
|
|
# Install dependencies with rosdep
|
|
RUN apt-get update && \
|
|
rosdep update && \
|
|
rosdep install --from-paths src --ignore-src -r -y && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Build the workspace with symlink install
|
|
RUN . /opt/ros/jazzy/setup.sh && \
|
|
colcon build --symlink-install
|
|
|
|
# Source the overlay on container startup
|
|
RUN echo "source /opt/ros/jazzy/setup.bash" >> /root/.bashrc && \
|
|
echo "source /ros2_ws/install/setup.bash" >> /root/.bashrc
|
|
|
|
CMD ["bash"]
|