What does `crane flatten` or `docker buildx build --squash` do for supply chain?
AdvancedProductionRegistries, Tagging & Supply Chain
Answer
Flattening collapses layers into one, removing deleted-but-present data (a leaked-then-deleted secret would be gone from the new image, though not from the old tag in the registry). It breaks layer reuse and caching, so only do it for special artifacts. The real fix for leaks is rotation plus preventing them with secret mounts.
More on Registries, Tagging & Supply Chain
What is a good image tagging strategy for production?BeginnerWhy is deploying by digest better than by tag?IntermediateHow do you enable immutable tags and lifecycle rules in ECR?IntermediateHow does ECR handle scanning and replication?IntermediateHow do you give an EKS node or CI job access to ECR with least privilege?IntermediateDocker Hub vs ECR vs GHCR vs Harbor: how do you choose?Intermediate