Create better caching of rosdep dependencies

For both  devcontainer and deployable container.
Also add ability to use docker from inside the devcontainer.
This commit is contained in:
Matt Spencer
2026-07-16 07:12:48 +00:00
parent 76701e81c0
commit f97df2273b
6 changed files with 123 additions and 14 deletions
+15
View File
@@ -25,7 +25,22 @@ RUN cd ./src/upstream/livox_ros_driver2 && \
# Apply patches to upstream
# RUN ./patches/apply_patches.sh
# system deps from frozen rosdep manifest — no rosdep at build or startup
# NOTE: There should be a check in your CI that this file is up to date.
# Something like:
# ./scripts/freeze-rosdep.sh && git diff --exit-code rosdep-packages.txt
COPY rosdep-packages.txt /tmp/rosdep-packages.txt
# The --mount=type=cache option caches the apt packages with buildkit
# The id-apt-cache-${TARGETARCH} option allows for separate caches for different architectures
# this enables parallel builds for different architectures without cache conflicts
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-cache-${TARGETARCH} \
rm -f /etc/apt/apt.conf.d/docker-clean \
&& apt-get update \
&& xargs -r -a /tmp/rosdep-packages.txt apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies with rosdep
# This will catch anything that wasn't installed via .deb's from the frozen rosdep manifest.
RUN apt-get update && \
rosdep update && \
rosdep install --from-paths src --ignore-src -r -y && \