优化镜像清理命令

This commit is contained in:
2026-01-07 12:00:06 +08:00
parent d9cdce0965
commit 094741ba00
+2
View File
@@ -75,6 +75,7 @@ steps:
if [ "${CI_COMMIT_BRANCH}" = "main" ]; then
echo "\nBuild and push image(with latest): $SWR_REGISTRY_REPO:$IMAGE_TAG"
docker buildx build --platform linux/amd64,linux/arm64 -t "$SWR_REGISTRY_REPO:$IMAGE_TAG" -t "$SWR_REGISTRY_REPO:latest" --push --provenance=false --sbom=false .
docker rmi "$SWR_REGISTRY_REPO:latest"
else
echo "\nBuild and push image: $SWR_REGISTRY_REPO:$IMAGE_TAG"
docker buildx build --platform linux/amd64,linux/arm64 -t "$SWR_REGISTRY_REPO:$IMAGE_TAG" --push --provenance=false --sbom=false .
@@ -84,3 +85,4 @@ steps:
echo "\nCleaning up unused build cache..."
docker buildx prune -f
docker rmi $(docker images -f "dangling=true" -q) "$SWR_REGISTRY_REPO:$IMAGE_TAG"