mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 02:48:45 +08:00
3a997e8056
https://github.com/milvus-io/milvus/issues/35209 https://github.com/milvus-io/milvus/pull/35208 --------- Signed-off-by: Yellow Shine <sammy.huang@zilliz.com>
50 lines
1.3 KiB
Bash
Executable File
50 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -eo pipefail
|
|
|
|
source ./build/util.sh
|
|
|
|
# Absolute path to the toplevel milvus directory.
|
|
toplevel=$(dirname "$(cd "$(dirname "${0}")"; pwd)")
|
|
|
|
if [[ "$IS_NETWORK_MODE_HOST" == "true" ]]; then
|
|
sed -i '/builder:/,/^\s*$/s/image: \${IMAGE_REPO}\/milvus-env:\${OS_NAME}-\${DATE_VERSION}/&\n network_mode: "host"/' $toplevel/docker-compose.yml
|
|
fi
|
|
|
|
if [[ -f "$toplevel/.env" ]]; then
|
|
set -a # automatically export all variables from .env
|
|
source $toplevel/.env
|
|
set +a # stop automatically exporting
|
|
fi
|
|
|
|
pushd "${toplevel}"
|
|
|
|
if [[ "${1-}" == "pull" ]]; then
|
|
$DOCKER_COMPOSE_COMMAND pull builder
|
|
exit 0
|
|
fi
|
|
|
|
if [[ "${1-}" == "down" ]]; then
|
|
$DOCKER_COMPOSE_COMMAND down
|
|
exit 0
|
|
fi
|
|
|
|
PLATFORM_ARCH="${PLATFORM_ARCH:-${IMAGE_ARCH}}"
|
|
|
|
export IMAGE_ARCH=${PLATFORM_ARCH}
|
|
|
|
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-ccache"
|
|
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-go-mod"
|
|
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-vscode-extensions"
|
|
mkdir -p "${DOCKER_VOLUME_DIRECTORY:-.docker}/${IMAGE_ARCH}-${OS_NAME}-conan"
|
|
chmod -R 777 "${DOCKER_VOLUME_DIRECTORY:-.docker}"
|
|
|
|
$DOCKER_COMPOSE_COMMAND pull builder
|
|
if [[ "${CHECK_BUILDER:-}" == "1" ]]; then
|
|
$DOCKER_COMPOSE_COMMAND build builder
|
|
fi
|
|
|
|
$DOCKER_COMPOSE_COMMAND run --no-deps --rm builder "$@"
|
|
|
|
popd
|