From b435aab0fb51235e2d177b2512da77a3ec03dc39 Mon Sep 17 00:00:00 2001 From: Michael Ripperger Date: Wed, 23 Jul 2025 21:02:12 -0500 Subject: [PATCH] Updated Dockerfile to use tmpfs mount --- docker/Dockerfile | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index ce8be811..c695f5d2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -19,19 +19,18 @@ RUN apt install -y wget \ && apt install -y libqt-advanced-docking-system-dev \ ; fi +# Install the dependency repositories +# Use a tmpfs mount for the workspace so as not to unnecessarily copy files into the final image # Bind mount the source directory so as not to unnecessarily copy source code into the docker image -ARG WORKSPACE_DIR=/opt/tesseract_qt -RUN --mount=type=bind,target=${WORKSPACE_DIR}/src/tesseract_qt \ +ARG WORKSPACE_DIR=/tmpfs/tesseract_qt +ARG INSTALL_DIR=/opt/tesseract_qt +RUN mkdir -p ${INSTALL_DIR} + +RUN --mount=type=tmpfs,target=${WORKSPACE_DIR} --mount=type=bind,target=${WORKSPACE_DIR}/src/tesseract_qt \ cd ${WORKSPACE_DIR} \ && rosdep install \ --from-paths ${WORKSPACE_DIR}/src \ - -iry - -# Build the repository -# Bind mount the source directory so as not to unnecessarily copy source code into the docker image -RUN --mount=type=bind,target=${WORKSPACE_DIR}/src/tesseract_qt \ - source /opt/tesseract/install/setup.bash \ + -iry \ && source /opt/tesseract_planning/install/setup.bash \ - && cd ${WORKSPACE_DIR} \ && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_RENDERING=OFF -DBUILD_STUDIO=OFF \ - && rm -rf build log + && cp -r ${WORKSPACE_DIR}/install ${INSTALL_DIR}