From 40acd35ad7b0866f173bb4a334f62ab369110800 Mon Sep 17 00:00:00 2001 From: nanxun Date: Tue, 11 Aug 2026 14:22:44 +0800 Subject: [PATCH] ci: reduce Docker build disk usage --- .dockerignore | 2 ++ Jenkinsfile | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.dockerignore b/.dockerignore index 7fa7980..e1a1230 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,6 +7,8 @@ .codex-temp/ .codex_tmp_danmaku .codex_tmp_danmaku/ +.ci +.ci/ artifacts artifacts/ ConsoleApp1 diff --git a/Jenkinsfile b/Jenkinsfile index b3953d5..ae29996 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -208,9 +208,9 @@ pipeline { --build-arg http_proxy="$HTTP_PROXY_URL" \ --build-arg https_proxy="$HTTP_PROXY_URL" \ --build-arg no_proxy="$NO_PROXY_HOSTS" \ - -f src/LiveRecorder.WebApi/Dockerfile -t "$api_ref" --load . - ./scripts/ci-docker.sh push "$api_ref" - ./scripts/ci-docker.sh rmi "$api_ref" >/dev/null + -f src/LiveRecorder.WebApi/Dockerfile -t "$api_ref" --push . + ./scripts/ci-docker.sh buildx prune \ + --builder "$BUILDER_NAME" --all --force ./scripts/ci-docker.sh buildx build \ --builder "$BUILDER_NAME" --platform "$platform" --network host \ @@ -224,9 +224,9 @@ pipeline { --build-arg https_proxy="$HTTP_PROXY_URL" \ --build-arg no_proxy="$NO_PROXY_HOSTS" \ --build-arg VITE_API_BASE_URL=/api \ - -f frontend/Dockerfile -t "$web_ref" --load frontend - ./scripts/ci-docker.sh push "$web_ref" - ./scripts/ci-docker.sh rmi "$web_ref" >/dev/null + -f frontend/Dockerfile -t "$web_ref" --push frontend + ./scripts/ci-docker.sh buildx prune \ + --builder "$BUILDER_NAME" --all --force ''' } } @@ -255,9 +255,9 @@ pipeline { --build-arg http_proxy="$HTTP_PROXY_URL" \ --build-arg https_proxy="$HTTP_PROXY_URL" \ --build-arg no_proxy="$NO_PROXY_HOSTS" \ - -f src/LiveRecorder.WebApi/Dockerfile -t "$api_ref" --load . - ./scripts/ci-docker.sh push "$api_ref" - ./scripts/ci-docker.sh rmi "$api_ref" >/dev/null + -f src/LiveRecorder.WebApi/Dockerfile -t "$api_ref" --push . + ./scripts/ci-docker.sh buildx prune \ + --builder "$BUILDER_NAME" --all --force ./scripts/ci-docker.sh buildx build \ --builder "$BUILDER_NAME" --platform "$platform" --network host \ @@ -271,9 +271,9 @@ pipeline { --build-arg https_proxy="$HTTP_PROXY_URL" \ --build-arg no_proxy="$NO_PROXY_HOSTS" \ --build-arg VITE_API_BASE_URL=/api \ - -f frontend/Dockerfile -t "$web_ref" --load frontend - ./scripts/ci-docker.sh push "$web_ref" - ./scripts/ci-docker.sh rmi "$web_ref" >/dev/null + -f frontend/Dockerfile -t "$web_ref" --push frontend + ./scripts/ci-docker.sh buildx prune \ + --builder "$BUILDER_NAME" --all --force ''' } }