image-util.sh: fix gcr.io/.../agnhost:2.46-linux-amd64 is a manifest list

Fix issue 123266

> CI: `post-kubernetes-push-e2e-agnhost-test-images` is failing
> (`gcr.io/k8s-staging-e2e-test-images/agnhost:2.46-linux-amd64 is a manifest list`)

To avoid creating a manifest list with the recent version of buildx,
`--provenance=false --sbom=false` has to be specified.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2024-02-14 01:37:05 +09:00
parent 498f02d18c
commit 6ff675310c
No known key found for this signature in database
GPG Key ID: 49524C6F9F638F1A

View File

@ -185,7 +185,8 @@ build() {
"${SED}" -i '/CROSS_BUILD_/d' Dockerfile
fi
docker buildx build --progress=plain --no-cache --pull --output=type="${output_type}" --platform "${os_name}/${arch}" \
# `--provenance=false --sbom=false` is set to avoid creating a manifest list: https://github.com/kubernetes/kubernetes/issues/123266
docker buildx build --progress=plain --no-cache --pull --output=type="${output_type}" --platform "${os_name}/${arch}" --provenance=false --sbom=false \
--build-arg BASEIMAGE="${base_image}" --build-arg REGISTRY="${REGISTRY}" --build-arg OS_VERSION="${os_version}" \
-t "${REGISTRY}/${image}:${TAG}-${suffix}" -f "${dockerfile_name}" \
--label "image_version=${TAG}" --label "commit_id=${GIT_COMMIT_ID}" \