From fda6f8d04e786e3a61552d2229e0daee07c9580a Mon Sep 17 00:00:00 2001 From: "sammy.huang" Date: Tue, 30 Jan 2024 19:23:04 +0800 Subject: [PATCH] enhance: hotfix docker-compose.yml (#30378) Signed-off-by: Sammy Huang --- build/build_image.sh | 2 +- build/builder.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build/build_image.sh b/build/build_image.sh index e548af271f921..68a2cc82f6720 100755 --- a/build/build_image.sh +++ b/build/build_image.sh @@ -44,7 +44,7 @@ BUILD_ARGS="${BUILD_ARGS:---build-arg TARGETARCH=${IMAGE_ARCH}}" pushd "${toplevel}" -docker build ${BUILD_ARGS} --platform linux/${IMAGE_ARCH} -f "./build/docker/milvus/${OS_NAME}/Dockerfile" -t "${MILVUS_IMAGE_REPO}:${MILVUS_IMAGE_TAG}" . +docker build --network host ${BUILD_ARGS} --platform linux/${IMAGE_ARCH} -f "./build/docker/milvus/${OS_NAME}/Dockerfile" -t "${MILVUS_IMAGE_REPO}:${MILVUS_IMAGE_TAG}" . image_size=$(docker inspect ${MILVUS_IMAGE_REPO}:${MILVUS_IMAGE_TAG} -f '{{.Size}}'| awk '{ byte =$1 /1024/1024/1024; print byte " GB" }') diff --git a/build/builder.sh b/build/builder.sh index b01f243082c2e..2938884150751 100755 --- a/build/builder.sh +++ b/build/builder.sh @@ -2,6 +2,9 @@ set -euo pipefail +# hot fix for docker-compose.yml, force builder service to use host network +sed -i '/builder:/,/^\s*$/s/image: \${IMAGE_REPO}\/milvus-env:\${OS_NAME}-\${DATE_VERSION}/&\n network_mode: "host"/' docker-compose.yml + # Absolute path to the toplevel milvus directory. toplevel=$(dirname "$(cd "$(dirname "${0}")"; pwd)")