Skip to content

Fix Heroku container push failing with "unsupported" media type#57

Open
hananasen wants to merge 1 commit into
mainfrom
fix-heroku-oci-mediatypes
Open

Fix Heroku container push failing with "unsupported" media type#57
hananasen wants to merge 1 commit into
mainfrom
fix-heroku-oci-mediatypes

Conversation

@hananasen

Copy link
Copy Markdown
Contributor

Summary

  • BuildKit v0.31.0 changed the image exporter to default to OCI media types for all pushes (previously this only happened when attestations/annotations were present).
  • Heroku's container registry only accepts the legacy Docker v2 schema2 manifest format, so heroku-container.yml deploys started failing with failed to push registry.heroku.com/<app>/<target>: unsupported.
  • This regression surfaced without any change to this repo or the caller's Dockerfile/workflow — moby/buildkit:buildx-stable-1 is a floating tag, and the builder silently picked up BuildKit v0.31.2 between two deploys of awslimitchecker (last success on BuildKit v0.30.0).
  • Fix: replace --tag ... --push with an explicit --output type=image,...,oci-mediatypes=false so the pushed manifest stays in the legacy format Heroku supports, regardless of which BuildKit patch version gets pulled.

Test plan

BuildKit v0.31.0 changed the image exporter to default to OCI media
types for all pushes (previously only when attestations/annotations
were present). Heroku's container registry only supports the legacy
Docker v2 schema2 manifest format, so pushes started failing with:

  ERROR: failed to push registry.heroku.com/<app>/<target>: unsupported

Explicitly set oci-mediatypes=false via --output to keep pushing the
legacy format regardless of the BuildKit version pulled by the
floating moby/buildkit:buildx-stable-1 tag.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the reusable Heroku container deployment workflow to avoid BuildKit’s newer default OCI media types when pushing images, restoring compatibility with Heroku’s container registry which expects legacy Docker v2 schema2 manifests.

Changes:

  • Switches from --tag ... --push to an explicit --output ... oci-mediatypes=false to force legacy Docker media types on push.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

docker buildx build \
--target "$target" \
--tag "registry.heroku.com/$APP/$target" \
--output "type=image,name=registry.heroku.com/$APP/$target,push=true,oci-mediatypes=false" \
hananasen added a commit that referenced this pull request Jul 21, 2026
Temporary branch to confirm the "unsupported" Heroku push failure is
caused by BuildKit v0.31.0's new oci-mediatypes=true default, by
pinning the builder back to the last known-good version. Not intended
to be deployed or merged - see PR #57 for the actual fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants