buildpacks / imgutil

Helpful utilities for working with images
Apache License 2.0
23 stars 41 forks source link

Force the digest to be the same when saving sparse images #249

Closed natalieparellano closed 5 months ago

natalieparellano commented 5 months ago

A sparse image is always constructed "from" another image, and this package is typically used to save "base" images (build or run) from the registry or wherever to disk. In such scenarios, it is surprising for the digest to mutate when saving. In a sense, sparse images do not really need to be imgutil.Images at all, they just need to be v1.Images.

However for other local/remote/layout packages, we typically want to zero out timestamps in order to fulfill the reproducibility expectations of CNB, so preserving the digest when saving is not the default behavior.