When I tried to push the docker image to heroku, there is an error like this.
I looked up for information but there’s no information about it. I tried to specify the platform to linux/amd64 but it still didn’t work. What is the problem and how can I solve it? Thank you.
You’re getting this error:
error from registry: unsupported
unsupported
Error: docker push exited with Error: 1
This usually means Heroku doesn’t support your Docker image format or architecture.
Here’s a simple explanation and solution:
What’s the problem?
Your Docker image might be built for a platform or format that Heroku does not support, such as:
linux/arm64
(common on M1/M2 Macs)
- OCI image format instead of Docker V2
How to fix it (simple steps):
Option 1: Force Docker to build with linux/amd64
architecture
Run this before building your image:
DOCKER_DEFAULT_PLATFORM=linux/amd64
Then rebuild and push:
docker build -t registry.heroku.com/maven-java-app/web .
docker push registry.heroku.com/maven-java-app/web
If you’re on Windows PowerShell, set it like this before running docker build
:
$env:DOCKER_DEFAULT_PLATFORM="linux/amd64"
Option 2: Rebuild using Docker CLI only (no buildx)
If you’re using docker buildx
, Heroku sometimes rejects those images. Use regular build:
docker build --platform linux/amd64 -t registry.heroku.com/maven-java-app/web .