buildpacks / pack

CLI for building apps using Cloud Native Buildpacks
https://buildpacks.io
Apache License 2.0
2.56k stars 286 forks source link

pack should not create an ephemeral builder if it isn't truly needed #2195

Closed natalieparellano closed 2 months ago

natalieparellano commented 3 months ago

Description

Today, we always create an ephemeral builder, because we assume that it's an inexpensive operation if nothing changed.

When containerd storage is enabled, we can no longer omit base layers for images when saving (see https://github.com/buildpacks/imgutil/pull/222#discussion_r1372167387). This unfortunately makes creating ephemeral builders expensive. We should only do this when it's absolutely necessary.

Proposed solution

Return the original builder if no buildpacks were added, order was not modified, etc.

Describe alternatives you've considered

Additional context