diff --git a/deploy/kubernetes/deployment.yaml b/deploy/kubernetes/deployment.yaml index 15f80be..d3f0579 100644 --- a/deploy/kubernetes/deployment.yaml +++ b/deploy/kubernetes/deployment.yaml @@ -58,7 +58,7 @@ spec: mountPath: /vol containers: - name: aiops - image: lghost/aiops:dev + image: lghost/aiops:v0.1.1 imagePullPolicy: Always ports: - name: http diff --git a/deploy/kubernetes/quick-deploy.yaml b/deploy/kubernetes/quick-deploy.yaml index ca2162e..1852356 100644 --- a/deploy/kubernetes/quick-deploy.yaml +++ b/deploy/kubernetes/quick-deploy.yaml @@ -75,7 +75,7 @@ spec: mountPath: /vol containers: - name: aiops - image: lghost/aiops:dev + image: lghost/aiops:v0.1.1 imagePullPolicy: IfNotPresent ports: - containerPort: 8080 diff --git a/run.sh b/run.sh index b0bd3e7..1847095 100755 --- a/run.sh +++ b/run.sh @@ -505,27 +505,24 @@ build_embed_image() { clean_frontend_artifacts clean_embed_static + export DOCKERHUB_IMAGE export DOCKER_BUILDKIT=1 - local build_args=( - -f Dockerfile - --build-arg "VERSION=${BUILD_VERSION}" - --build-arg "BUILD_TIME=${BUILD_TIME}" - --build-arg "GIT_COMMIT=${GIT_COMMIT}" - --label "org.opencontainers.image.version=${BUILD_VERSION}" - -t "$EMBED_IMAGE" - -t "${DOCKERHUB_IMAGE}:dev" - . - ) - if [ "$no_cache" -eq 1 ]; then - build_args=(--no-cache --pull "${build_args[@]}") - info "无缓存全量构建 (--no-cache --pull)" + export COMPOSE_DOCKER_CLI_BUILD=1 + local compose_cmd + compose_cmd=$(detect_compose_cmd) + if [ -z "$compose_cmd" ]; then + error "Docker Compose 未安装,无法构建 embed 镜像" + return 1 fi - info "构建中(前端 + 后端 embed)..." - docker build "${build_args[@]}" || { - error "镜像构建失败" - return 1 - } + info "使用 $compose_cmd build(version=$BUILD_VERSION)..." + if [ "$no_cache" -eq 1 ]; then + info "无缓存全量构建 (--no-cache)..." + $compose_cmd build --no-cache aiops || { error "镜像构建失败"; return 1; } + else + $compose_cmd build aiops || { error "镜像构建失败"; return 1; } + fi + docker tag "$EMBED_IMAGE" "${DOCKERHUB_IMAGE}:dev" 2>/dev/null || true local img_size img_size=$(docker images "$EMBED_IMAGE" --format "{{.Size}}" | head -1)