Skip to content

Commit ffedeff

Browse files
rucoderrene
authored andcommitted
GHA: targeted cleanup — preserve BuildKit ccache across runs
- Replace nuclear 'docker system prune -af' and 'docker volume prune -af' with targeted removal of only the image we just built - Add clean-gcc/clean-clang Makefile targets that remove specific image from both linuxkit cache and docker - Add BuildKit cache pruning with configurable quota via BUILDX_KEEP_STORAGE_MB env var (defaults to 20000 MB) to prevent unbounded disk growth - Print BuildKit disk usage before pruning for diagnostics - Use buildctl inside linuxkit-builder container for cache management - Switch pr-build.yml from pull_request_target to pull_request - Remove unnecessary Docker Hub login from PR builds Signed-off-by: Mikhail Malyshev <mike.malyshev@gmail.com> (cherry picked from commit 04d9224)
1 parent ac1bd89 commit ffedeff

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Makefile.eve

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ docker-tag-clang: docker-tag-generate-clang
8484
push-gcc: push-image-gcc
8585
push-clang: push-image-clang
8686

87-
.PHONY: kernel-gcc kernel-clang docker-tag-gcc docker-tag-clang push-gcc push-clang
87+
clean-gcc: clean-image-gcc
88+
clean-clang: clean-image-clang
89+
90+
.PHONY: kernel-gcc kernel-clang docker-tag-gcc docker-tag-clang push-gcc push-clang clean-gcc clean-clang
8891

8992
docker-tag-generate-%:
9093
@echo "docker.io/$(IMAGE_REPOSITORY):$(BRANCH)-$(VERSION)$(DIRTY)-$*"
@@ -93,6 +96,10 @@ push-image-%:
9396
$(if $(DIRTY), $(error "Not pushing since the repo is dirty"))
9497
$(LK) cache push $(IMAGE_REPOSITORY):$(BRANCH)-$(VERSION)-$*
9598

99+
clean-image-%:
100+
$(LK) cache rm $(IMAGE_REPOSITORY):$(BRANCH)-$(VERSION)$(DIRTY)-$* 2>/dev/null || true
101+
docker rmi $(IMAGE_REPOSITORY):$(BRANCH)-$(VERSION)$(DIRTY)-$* 2>/dev/null || true
102+
96103
.PHONY: clean
97104
clean:
98-
echo "Cleaning"
105+
$(LK) cache clean

0 commit comments

Comments
 (0)