Skip to content

Decouple extend phase from kaniko #414

@natalieparellano

Description

@natalieparellano

The lifecycle currently uses kaniko as a library to perform build- and run-image extension, but kaniko has fallen into unmaintained status making it impractical and undesirable to rely on this dependency.

Possible alternatives considered:

  • buildah
  • buildkit

As a first step, we should decouple the CNB platform spec from the extender implementation, making it possible for platforms to "bring their own" extender. To note:

  • /kaniko is a required input directory for the restorer and the extender when using extensions, as a way of handing off the manifest & config file of the image to extend
    • This may not be desirable in all cases. For example an alternative extender might simply read the run image reference in analyzed.toml after it has been resolved by the restorer (after image extensions may have switched it from the original)
  • kaniko-cache-ttl is an optional flag for the extender
  • The exporter expects that the extended run image manifest, config, and layers will be available in OCI layout format in <layers>/extended/run after running the extend phase
    • This may not be desirable in all cases. For example an alternative extender might simply update the run image reference used by the exporter instead of providing layer tars

Important
Because we are using kaniko as a library, we are currently able to combine build image extension with the lifecycle build phase as a single command invocation within a single container. This may not be achievable with alternative extender implementations.

The lifecycle currently ships with /cnb/lifecycle/extender (which is just a symlink pointing back to /cnb/lifecycle/lifecycle) - we might want to rip that out after a sufficient deprecation period. We could start by shipping it as a separate tarball/image - e.g., something like index.docker.io/buildpacksio/extender:latest so that the kaniko code is at least isolated from the rest of the lifecycle.

In the end, we might provide an alternative project-supported extender, or simply rely on platforms to bring their own. Perhaps the various implementations could live in buildpacks-community as a middle ground.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions