Description
Description
The pack builder create
and pack buildpack package
commands both support a --label
argument for adding OCI image labels to the builder and buildpacks images respectively, added in #2034 and #1877. Similarly, buildpacks can set app image labels via the [[labels]]
table in launch.toml
- for example as used by paketo-buildpacks/image-labels.
However, it's not currently possible to add labels to the app image when calling pack build
.
This means that in basecamp/kamal#916 the service
label required by Kamal can't be set when calling pack build
, and instead the paketo-buildpacks/image-labels
buildpack has to be injected. This has a couple of downsides:
- The builder's default buildpack order is overridden, so now the user must always specify an explicit list of buildpacks rather than being able to rely on the curated defaults in the builder should they wish.
- Users may get confused why there are more buildpacks being run than the list of buildpacks they requested, given that an extra buildpack has had to be injected.
If pack build
supported setting image labels natively, then there would be no need to use this buildpack injection based approach.
Proposed solution
Add --label
support to pack build
, similar to that already supported by pack builder create
and pack buildpack package
.
cc @nickhammond