Skip to content

New arm64 macbooks fail to bootBuildImage due to incorrect platform image #46665

@ofirm93

Description

@ofirm93

I use the following:
Apple Macbook Pro M4 Pro (arm64)
docker version 4.42.1
Springboot 3.5.4
Springboot Gradle plugin 3.5.4

In latest version of plugin a new error appears when trying to build image using bootBuildImage task.
I try to build amd64 image on my arm processor and I use the relatively new imagePlatform property.
When the plugin tries to pull the buildpacks requested and one of them is not found in the builder, it downloads it from docker hub.
In that case the plugin implements the docker calls (in DockerApi class) which are the equivalent of the following docker cli commands:

docker pull --platform <imagePlatform> <buildpack>
docker save <buildpack>

The problem is in the second command implementation, as it doesn't provide the requested platform.
In such case dockerd decides the platform is the host platform, which in my case is arm64 which doesn't match the pulled image platform.
Hence the plugin sends the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':radius-core:bootBuildImage'.
> Invalid buildpack reference '<buildpack>'

I checked in dockerd related repos, and they do not seem to agree on a solution for the docker save command issue but require the command to include the --platform flag in that case.
I think this should also be fixed in Springboot DockerApi class so people with arm processors will be able to build amd images too.
I got an idea of a fix but I'm not sure how to propagate the platform to DockerApi. Can I get help on that matter?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions