Skip to content

Commit bf166bf

Browse files
committed
fix(docker): build kit volume mounting
1 parent bc5980b commit bf166bf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ ARG USER_GID
2626
# Copy source code from the workspace's ROS 2 packages to a workspace inside the container
2727
ARG USER_WS=/home/${USERNAME}/user_ws
2828
ENV USER_WS=${USER_WS}
29-
RUN mkdir -p ${USER_WS}/src ${USER_WS}/build ${USER_WS}/install ${USER_WS}/log
30-
COPY ./src ${USER_WS}/src
3129

3230
# Also mkdir with user permission directories which will be mounted later to avoid docker creating them as root
3331
WORKDIR $USER_WS
@@ -67,6 +65,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
6765
# hadolint ignore=SC1091
6866
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
6967
--mount=type=cache,target=/var/lib/apt,sharing=locked \
68+
--mount=type=bind,target=${USER_WS}/,source=. \
7069
. /opt/overlay_ws/install/setup.sh && \
7170
apt-get update && \
7271
rosdep install -q -y \

0 commit comments

Comments
 (0)