Skip to content

Image building may fail when specifying a platform if an image has already been built with a different platform #46674

@wilkinsona

Description

@wilkinsona

See #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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions