[#15] 增加镜像构建 --no-cache选项

This commit is contained in:
2025-10-13 15:17:33 +08:00
parent ee13c8d094
commit 0e96c5bcb0
2 changed files with 21 additions and 1 deletions

View File

@@ -3,12 +3,13 @@ set -euo pipefail
usage() {
cat >&2 <<'USAGE'
Usage: $0 [--intranet] [--offline] [--tag <image_tag>]
Usage: $0 [--intranet] [--offline] [--tag <image_tag>] [--no-cache]
Options:
--intranet 使用指定的 PyPI 镜像源(默认清华镜像)。
--offline 完全离线构建,依赖 offline_wheels/ 目录中的离线依赖包。
--tag <image_tag> 自定义镜像标签,默认 argus-master:latest。
--no-cache 不使用 Docker 构建缓存。
USAGE
}
@@ -19,6 +20,7 @@ IMAGE_TAG="${IMAGE_TAG:-argus-master:latest}"
DOCKERFILE="src/master/Dockerfile"
BUILD_ARGS=()
OFFLINE_MODE=0
NO_CACHE=0
source "$PROJECT_ROOT/scripts/common/build_user.sh"
load_build_user
@@ -45,6 +47,11 @@ while [[ "$#" -gt 0 ]]; do
IMAGE_TAG="$2"
shift 2
;;
--no-cache)
NO_CACHE=1
BUILD_ARGS+=("--no-cache")
shift
;;
-h|--help)
usage
exit 0