Skip to content

Commit 8aee568

Browse files
authored
Updated Dockerfile to use tmpfs mount (#649)
1 parent 2d0af6f commit 8aee568

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docker/Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ RUN apt update -y -qq \
1818
apt install -y libompl-dev libtaskflow-cpp-dev \
1919
; fi
2020

21+
# Install the dependency repositories
22+
# Use a tmpfs mount for the workspace so as not to unnecessarily copy files into the final image
2123
# Bind mount the source directory so as not to unnecessarily copy source code into the docker image
22-
ARG WORKSPACE_DIR=/opt/tesseract_planning
23-
RUN --mount=type=bind,target=${WORKSPACE_DIR}/src/tesseract_planning \
24+
ARG WORKSPACE_DIR=/tmpfs/tesseract_planning
25+
ARG INSTALL_DIR=/opt/tesseract_planning
26+
RUN mkdir -p ${INSTALL_DIR}
27+
28+
RUN --mount=type=tmpfs,target=${WORKSPACE_DIR} --mount=type=bind,target=${WORKSPACE_DIR}/src/tesseract_planning \
2429
cd ${WORKSPACE_DIR} \
2530
&& vcs import src < src/tesseract_planning/dependencies.repos --shallow \
2631
&& rosdep install \
2732
--from-paths ${WORKSPACE_DIR}/src \
28-
-iry
29-
30-
# Build the repository
31-
# Bind mount the source directory so as not to unnecessarily copy source code into the docker image
32-
RUN --mount=type=bind,target=${WORKSPACE_DIR}/src/tesseract_planning \
33-
source /opt/tesseract/install/setup.bash \
33+
-iry \
34+
&& source /opt/tesseract/install/setup.bash \
3435
&& source /opt/trajopt/install/setup.bash \
35-
&& cd ${WORKSPACE_DIR} \
3636
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release \
37-
&& rm -rf build log
37+
&& cp -r ${WORKSPACE_DIR}/install ${INSTALL_DIR}

0 commit comments

Comments
 (0)