From 585e42dac7b59a2632e43a516b6051815fe5ea6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=80=BB=E5=B7=A5?= Date: Sat, 29 Aug 2026 13:44:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E7=BD=B2(HEL-235):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=9E=84=E5=BB=BA=E5=90=8E=E5=9B=9E=E8=AF=BB=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E7=9A=84=E8=BF=9C=E7=AB=AF=E6=A8=A1=E6=9D=BF=E5=BC=95?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: multica-agent --- tools/build_image.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/build_image.sh b/tools/build_image.sh index 08213d4..5be2ca7 100755 --- a/tools/build_image.sh +++ b/tools/build_image.sh @@ -74,15 +74,14 @@ git archive --format=tar "$FULL_SHA" \ - echo "==> 回读校验镜像内记录的提交号" -GOT="$(ssh -o BatchMode=yes "$HOST" docker image inspect "${REPO_NAME}:${TAG}" \ - --format '{{index .Config.Labels "org.opencontainers.image.revision"}}')" +GOT="$(ssh -o BatchMode=yes "$HOST" "docker image inspect ${REPO_NAME}:${TAG} --format '{{index .Config.Labels \"org.opencontainers.image.revision\"}}'" 2>/dev/null || true)" if [ "$GOT" != "$FULL_SHA" ]; then - echo "校验失败:镜像 revision=${GOT},期望 ${FULL_SHA}。删除不可信镜像,中止。" >&2 + echo "校验失败:镜像 revision='${GOT:-<空>}',期望 ${FULL_SHA}。删除不可信镜像,中止。" >&2 ssh -o BatchMode=yes "$HOST" docker rmi "${REPO_NAME}:${TAG}" >/dev/null 2>&1 || true exit 1 fi -IMAGE_ID="$(ssh -o BatchMode=yes "$HOST" docker image inspect "${REPO_NAME}:${TAG}" --format '{{.Id}}')" +IMAGE_ID="$(ssh -o BatchMode=yes "$HOST" "docker image inspect ${REPO_NAME}:${TAG} --format '{{.Id}}'")" SHORT_ID="${IMAGE_ID##*:}" ssh -o BatchMode=yes "$HOST" \