From cd17f5f3a32cd28b5b65b59470ad6d2b8fde7755 Mon Sep 17 00:00:00 2001 From: David Gardner Date: Thu, 25 Jul 2024 12:14:28 -0700 Subject: [PATCH] Use the local repo as the source of the git clone --- docker/Dockerfile | 10 +++++++--- docker/build_container.sh | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index b638a422ad..4f69391258 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -292,8 +292,12 @@ RUN --mount=type=bind,from=conda_bld_morpheus,source=/opt/conda/conda-bld,target # unintentionally including build artifacts or other files that shouldn't be in the final image FROM conda_env_dev as git_clone -RUN source activate morpheus &&\ - git clone file://${MORPHEUS_ROOT_HOST} /tmp/morpheus_repo &&\ +ARG MORPHEUS_ROOT_HOST + +# Source the morpheus env to pick up the git-lfs package +RUN --mount=type=bind,source=${MORPHEUS_ROOT_HOST},target=/opt/host_repo \ + source activate morpheus &&\ + git clone file:///opt/host_repo /tmp/morpheus_repo &&\ cd /tmp/morpheus_repo &&\ git lfs install &&\ /tmp/morpheus_repo/scripts/fetch_data.py fetch datasets examples @@ -309,7 +313,7 @@ COPY --from=git_clone "/tmp/morpheus_repo/conda/environments/*.yaml" "./conda/en COPY --from=git_clone "/tmp/morpheus_repo/docker" "./docker" COPY --from=build_docs "/workspace/build/docs/html" "./docs" COPY --from=git_clone "/tmp/morpheus_repo/examples" "./examples" -COPY --from=git_clone "/tmp/models/datasets" "./models/datasets" +COPY --from=git_clone "/tmp/morpheus_repo/models/datasets" "./models/datasets" COPY --from=git_clone "/tmp/morpheus_repo/scripts" "./scripts" COPY --from=git_clone "/tmp/morpheus_repo/*.md" "./" COPY --from=git_clone "/tmp/morpheus_repo/LICENSE" "./" diff --git a/docker/build_container.sh b/docker/build_container.sh index 76a4370195..36c2f7084d 100755 --- a/docker/build_container.sh +++ b/docker/build_container.sh @@ -52,7 +52,6 @@ DOCKER_ARGS="${DOCKER_ARGS} --build-arg LINUX_VER=${LINUX_VER}" DOCKER_ARGS="${DOCKER_ARGS} --build-arg MORPHEUS_ROOT_HOST=${MORPHEUS_ROOT_HOST}" DOCKER_ARGS="${DOCKER_ARGS} --build-arg MORPHEUS_SUPPORT_DOCA=${MORPHEUS_SUPPORT_DOCA}" DOCKER_ARGS="${DOCKER_ARGS} --build-arg PYTHON_VER=${PYTHON_VER}" -DOCKER_ARGS="${DOCKER_ARGS} --build-arg GIT_URL=${GIT_URL}" DOCKER_ARGS="${DOCKER_ARGS} --network=host" # Last add any extra args (duplicates override earlier ones)