From bc5980be71410c0a76b5454fa02f29bfa699b9d4 Mon Sep 17 00:00:00 2001 From: Ezra Brooks Date: Wed, 30 Jul 2025 14:16:52 -0600 Subject: [PATCH 1/2] Fix caching of dependency steps in Docker build `log` wasn't ignored in the build context and was causing cache busts. --- .dockerignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..5d4eed38d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +build +install +log From bf166bf5f718bad35bea41078e5ddad476970ef0 Mon Sep 17 00:00:00 2001 From: shaur-k Date: Tue, 11 Mar 2025 00:06:44 -0600 Subject: [PATCH 2/2] fix(docker): build kit volume mounting --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8006e4e09..ab66b73fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,8 +26,6 @@ ARG USER_GID # Copy source code from the workspace's ROS 2 packages to a workspace inside the container ARG USER_WS=/home/${USERNAME}/user_ws ENV USER_WS=${USER_WS} -RUN mkdir -p ${USER_WS}/src ${USER_WS}/build ${USER_WS}/install ${USER_WS}/log -COPY ./src ${USER_WS}/src # Also mkdir with user permission directories which will be mounted later to avoid docker creating them as root WORKDIR $USER_WS @@ -67,6 +65,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ # hadolint ignore=SC1091 RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \ + --mount=type=bind,target=${USER_WS}/,source=. \ . /opt/overlay_ws/install/setup.sh && \ apt-get update && \ rosdep install -q -y \