diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 70ebbc3..e850088 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,13 +40,15 @@ build-arm64: - arm64 script: - docker buildx build --platform=linux/arm64 --pull -t "$IMG_URL$IMG_TAG-linux-arm64" . --push + - docker rmi "$IMG_URL$IMG_TAG-linux-arm64" build-amd64: stage: build - tags: + tags: - amd64 script: - docker buildx build --platform=linux/amd64 --pull -t "$IMG_URL$IMG_TAG-linux-amd64" . --push + - docker rmi "$IMG_URL$IMG_TAG-linux-amd64" build-artifact: stage: build @@ -54,13 +56,16 @@ build-artifact: script: - docker manifest create "$IMG_URL$IMG_TAG" "$IMG_URL$IMG_TAG-linux-arm64" "$IMG_URL$IMG_TAG-linux-amd64" - docker manifest push "$IMG_URL$IMG_TAG" + - docker manifest rm "$IMG_URL$IMG_TAG" # 测试阶段任务 test: stage: test script: - docker run --rm --platform=linux/arm64 "$IMG_URL$IMG_TAG" /bin/uname -a + - sleep 1 && docker rmi -f "$IMG_URL$IMG_TAG" - docker run --rm --platform=linux/amd64 "$IMG_URL$IMG_TAG" /bin/uname -a + - sleep 1 && docker rmi -f "$IMG_URL$IMG_TAG" # 部署阶段任务 deploy: