fix: force Docker-compatible manifest media type for multi-platform pushes - #74
Conversation
…ushes BuildKit's default multi-platform output format silently drifted to OCI image index (application/vnd.oci.image.index.v1+json) between builds, with no change to this workflow. Docker Engine versions that predate OCI manifest support (e.g. the legacy Mesos/Marathon fleet, running 17.05.0-ce) cannot pull an image published this way and fail with a JSON-parse error trying to read the registry response. `push: true` is shorthand for `--output=type=registry`; replacing it with an explicit `outputs: type=registry,oci-mediatypes=false` keeps the same registry-push exporter but pins the manifest format to the legacy Docker distribution manifest list (schema2), regardless of future BuildKit default changes. Ref: ASANA-1210144815075383
There was a problem hiding this comment.
Pull request overview
This PR updates the Go app release workflow to explicitly force Docker schema2 manifest list media types when pushing multi-platform images, avoiding BuildKit default drift to OCI image indexes that break pulls on legacy Docker daemons.
Changes:
- Replace
push: truewith an explicit registry exporter output:outputs: type=registry,oci-mediatypes=false. - Keep existing build settings (provenance disabled, multi-platform build, tags/labels) unchanged while pinning the manifest format.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@ramu-n I am not sure if we would want to do that because it would make all docker images non oci format irrespective of marathon/non-marathon environment. I would recommend a caller input from marathon repos defaulting it to modern behaviour On the distribute side or any other marathon repo, there would be a following change |
Per review feedback: defaulting every consumer of this tag to legacy Docker schema2 manifests would silently affect repos that don't run on Marathon/Mesos and may want OCI-format images for other reasons (e.g. attestation/scanning tooling). Add LEGACY_DOCKER_MEDIATYPES (default false, preserving OCI/modern behavior) so only callers that actually need Docker-compatible manifests opt in explicitly. Ref: ASANA-1210144815075383
|
Good point — pushed an update. Added |
Summary
application/vnd.oci.image.index.v1+json) between twodistribute-apirelease builds, with zero change to this workflow — traced to the floatingmoby/buildkit:buildx-stable-1builder image advancing from v0.30.0 to v0.31.2 between build dates.17.05.0-ce(2017), which predates OCI manifest support entirely. Pulling an OCI-format image on that host fails withinvalid character '<' looking for beginning of value(the daemon can't parse the registry response).push: trueindocker/build-push-action@v3is documented shorthand for--output=type=registrywith no media-type control. Replacing it with an explicitoutputs: type=registry,oci-mediatypes=falsekeeps the exact same registry-push exporter already in use, but pins the manifest format to the legacy Docker distribution manifest list (schema2) so it no longer depends on BuildKit's evolving defaults.docker buildx imagetools inspectagainst the actual registry: known-good tag (rc05) wasapplication/vnd.docker.distribution.manifest.list.v2+json; known-bad tags (rc06,rc07,rc08) were allapplication/vnd.oci.image.index.v1+json.Scope
This only touches
go_app_release.yml. Existinggo/app/v1,go/app/v1.1.x, andgo/app/v2tags are untouched — repos pinned to those are unaffected. Once merged, this will be tagged as a newgo/app/v2.1fordistribute-api(and any other repo hitting the same legacy-Docker-host issue) to opt into.Test plan
docker/build-push-action@v3acceptsoutputsalongsideprovenance: falsewithout conflicting with the removedpushinput (buildx itself rejects--push+--outputtogether, sopush: truemust be removed, not just supplemented).go/app/v2.1, cut a newdistribute-apiRC tag against it and confirm the pushed manifest media type isapplication/vnd.docker.distribution.manifest.list.v2+jsonviadocker buildx imagetools inspect.Ref: ASANA-1210144815075383
🤖 Generated with Claude Code