Skip to content

[Documentation] Clarify mediatypes generation behaviour #6070

@GabriFedi97

Description

@GabriFedi97

As per output parameter documentation:

Keys supported by image output:
...
oci-mediatypes=true: use OCI mediatypes in configuration JSON instead of Docker's

However, the behaviour of buildkit seems not to always consider the value of that parameter. Even if the value is false, buildkit arbitrarily switches to OCI media types during container builds if:

  • the build invocation includes any kind of attestations (provenance, SBOM)
  • the build invocation includes annotations

Buildkit takes care of printing a warning in the log then the switch needs to happen, such as:

forcibly turning on oci-mediatype mode for attestations

but it is not easy detectable, given that this information is not immediately available when the build is performed using buildx or GitHub actions.

Moreover, the provenance attestation is something that gets added by default so it needs to be explicitly disabled for preventing the media-types change to happen.

I was unable to find this behaviour described anywhere in the docker/buildikit documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions