See https://github.com/spring-projects/spring-boot/issues/46665 for background.
On an ARM Mac, building an image with default configuration and then building it again with the image platform set to linux/amd64 results in a failure:
> Task :bootBuildImage
Building image 'docker.io/library/demo:0.0.1-SNAPSHOT'
> Pulling builder image 'docker.io/paketobuildpacks/builder-noble-java-tiny:latest' for platform 'linux/amd64' ..................................................
> Pulled builder image 'paketobuildpacks/builder-noble-java-tiny@sha256:ae0cd71a4e28e3c3ba07fc409d197f04d28ed321910a2474eeb496e37d6ecc05'
> Task :bootBuildImage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootBuildImage'.
> Image platform mismatch detected. The configured platform 'linux/amd64' is not supported by the image 'docker.io/paketobuildpacks/builder-noble-java-tiny:latest'. Requested platform 'linux/amd64' but got 'linux/arm64'
Wiping the state of the Docker daemon (docker system prune --all --force) and re-running the build fixes the problem.
This was diagnosed using 3.5.4 so I've assigned the issue to 3.5.x for now. 3.4.x may also be affected.
Comment From: bzsil8989
Is this issue still available for contribution?
Comment From: philwebb
@bzsil8989 It's not assigned to anyone, but it might be a little tricky to fix given the complexity around that area of the codebase.
Comment From: heruan
Would be great to have this fixed in 4.0
Comment From: hojooo
While testing this issue with Docker Desktop’s “Use containerd for pulling and storing images” enabled, I observed that current Docker API usage supports multi-arch during pull/create, but not during inspect/export.
Environment
- Docker Engine API: v1.51 (I haven't checked it in other versions.)
- Docker Desktop: M1 processor, Use containerd for pulling and storing images = ON
gradle bootBuildImage { builder = "paketobuildpacks/builder-noble-java-tiny:latest" imageName = "demo:v1" imagePlatform = "linux/amd64" buildpacks = ["paketobuildpacks/java","paketobuildpacks/opentelemetry:2"] }
What’s happening
- With the containerd image store, a tag like
builder-noble-java-tiny:latestis kept as a multi-platform index (manifest list) locally. DockerApistill inspects images using API v1.41, whereGET /images/{name}/jsondoes not support selecting a platform. In this case the daemon resolves the index using the host default platform (on Apple Silicon ->linux/arm64).- Meanwhile
bootBuildImageis asking forlinux/amd64. Result: inspect sees arm64 but the build requires amd64 → platform mismatch.
Workarounds for affected users (temporary)
- Set
DOCKER_DEFAULT_PLATFORM=linux/amd64or - Disable the containerd image store temporarily
I think I need to bump the PLATFORM_API_VERSION(1.41 now) or switch to per-endpoint minimums. I’m looking for feedback on the overall approach. Thanks.
Comment From: hiro345g
My Docker API version is 1.52 (Min 1.44), and I see the exact same 400 Bad Request error when using Spring Boot 3.5.7. See my detailed logs #48050
Comment From: philwebb
Closing in favor of PR #47292. Thanks @hojooo!