Skip to content

generate CNAB-OCI manifest in buildx build flow based on the results of the subcomponent builds #143

@andrewhsu

Description

@andrewhsu

When a multi-platform image is currently built in buildx using multiple nodes, each node pushes the components they built as a partial manifest list to the registry. As a result of completed build, the digests of the manifests are returned to the client where cli merges the submanifests into a single manifest-list and pushes it directly from the CLI.

The same logic should work for creating and pushing cnab manifest at the end of the app build and buildx needs to be modified with the code for creating the manifest that currently exists in docker app subcommand directly.

In the future, if buildkit gets support for doing multi-node builds internally this work can be possibly refactored into a frontend or buildkit exporter instead.

Buildx supports exporters (with --output) flag when doing a build. The app case needs to support the “registry” exporter for pushing into registry and “docker” exporter so that the built resource can be used directly in Docker for local development. Ideally, exporters like OCI-tarball exporter would work as well but probably lower priority atm.

The manifest list creation and pushing to the registry can be implemented in buildx directly with reusing the current components.

Future work: for exporting the manifest list into Docker for local developer flow and making it possible for the existing docker push to push “application images”, containerd storage integration support is first needed in the engine moby/moby#38043 Without this integration, the engine can’t address objects like manifest lists or registry layers or start containers from them. It also has no support for partial manifest chains (eg. for multi-platform resources) or OCI tarball formats. Containerd integration also splits the image concept into a “distribution image” that can be pushed/pulled and “runtime image” that can be used to run the container that is an important distinction for working with apps.

For the current code that creates a manifest list on the client-side by merging the existing ones you can look at https://github.com/docker/buildx/blob/master/build/build.go#L576-L598

relates to #140, ENGCORE-1013

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