-
Notifications
You must be signed in to change notification settings - Fork 441
Idea: ko rebase #358
Description
When a newer version of a base image is available, in some cases you can pick up those updates without having to completely rebuild your image from scratch on top of the new base image. Instead, you can rebase. It just so happens ko builds images that are amenable to rebasing. 👍
With future improvements to the OCI spec to declare standard annotations to signal base image information, crane will be able to take advantage of these annotations to detect and rebase images without any external information required.
ko resolve builds a bunch of images, by default based on gcr.io/distroless/static:nonroot. If ko produced images that wrote base image annotations, it could also have a CLI surface to ingest YAML generated by a previous ko resolve to detect image references, determine base image information for those images, identify new available base image versions, perform a rebase, and replace image references in the output YAML.
The result would be a workflow like: ko resolve > release.yaml, wait for a distroless release, ko rebase release.yaml > release.yaml, and release.yaml would now include images based on the new distroless release, without having to rebuild anything at all, or even have access to the original source.