-
Notifications
You must be signed in to change notification settings - Fork 844
Description
When using Buildah in CI pipelines with cached layers stored in the same registry as the target image, there are often cases where the resulting image is identical to a previously built one (no changes in layers).
In such cases, Buildah currently:
- Pulls all cache layers from the registry.
- Pushes them back unchanged (effectively no-op, since the layers are already present).
This behavior results in unnecessary time and bandwidth consumption, especially for large images.
Example CI job demonstrating this behavior: https://gitlab.freedesktop.org/MarekPikula/ci-multiplatform/-/jobs/83769470
Proposed improvement:
It would be highly beneficial if Buildah could detect this scenario and skip pulling/pushing unchanged layers, instead simply tagging the existing image in the registry. This seems to be the behavior of docker buildx
, and bringing a similar optimization to Buildah would significantly speed up CI workflows and reduce network usage.
I saw this briefly mentioned in #3382, but I don’t think the specific use case of skipping redundant pull/push cycles for unchanged images has been fully addressed.