By default, docker/build-push-action uses buildkit as a scope. In our Docker CI setup, we're building two images at the same time, and it seems that those caches were somehow overwritten in a way that they couldn't be reused. By setting the custom scope, the caching started working. In tests in my personal repo, the building time of the Debian image (one designed to use that caching well) went down from 9m 48s to 5m 41s.
By default,
docker/build-push-action
usesbuildkit
as a scope. In our Docker CI setup, we're building two images at the same time, and it seems that those caches were somehow overwritten in a way that they couldn't be reused. By setting the custom scope, the caching started working. In tests in my personal repo, the building time of the Debian image (one designed to use that caching well) went down from 9m 48s to 5m 41s.