Optimized Docker file

This commit is contained in:
2024-12-18 12:12:18 +01:00
parent 0a4ad93c0d
commit 3fbb943629

View File

@ -1,5 +1,5 @@
FROM arm64v8/ros:jazzy AS dev
RUN . /opt/ros/jazzy/setup.sh && sudo apt update
RUN mkdir -p /ros_ws/src/mg_navigation && \
mkdir -p /ros_ws/src/mg_msgs
@ -8,7 +8,10 @@ WORKDIR /ros_ws/src
COPY mg_navigation/package.xml mg_navigation/
COPY mg_msgs/package.xml mg_msgs/
RUN . /opt/ros/jazzy/setup.sh && rosdep install --from-paths ./ -i -y && \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
. /opt/ros/jazzy/setup.sh && apt update && rosdep install --from-paths ./ -i -y && \
rm -rf mg_navigation && \
rm -rf mg_msgs