Description
mvn spring-boot:build-image -Dspring-boot.build-image.imageName="$FULL_IMAGE_NAME" -DskipTests
fails in Bitbucket Pipeline with the following error message:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.4.0:build-image (default-cli) on project PROJECT-NAME: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.4.0:build-image failed: Docker API version must be at least 1.41 to support the 'imagePlatform' option, but current API version is 1.24
It works fine with Spring Boot 3.3.6.
Spring Boot 3.4.0
Bitbucket step image: maven:3.9.5-amazoncorretto-21-al2023
Maven configuration:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
<!-- CONFIG TO RUN BUILDPACKS IN BITBUCKET - begin -->
<!-- https://github.com/spring-projects/spring-boot/issues/28387 -->
<docker>
<bindHostToBuilder>true</bindHostToBuilder>
</docker>
<image>
<env>
<BP_JVM_VERSION>${java.version}</BP_JVM_VERSION>
</env>
<securityOptions/>
<buildWorkspace>
<bind>
<source>/opt/atlassian/pipelines/agent/build/cache-${project.artifactId}.work</source>
</bind>
</buildWorkspace>
<buildCache>
<bind>
<source>/opt/atlassian/pipelines/agent/build/cache-${project.artifactId}.build</source>
</bind>
</buildCache>
<launchCache>
<bind>
<source>/opt/atlassian/pipelines/agent/build/cache-${project.artifactId}.launch</source>
</bind>
</launchCache>
</image>
<!-- CONFIG TO RUN BUILDPACKS IN BITBUCKET - end -->
</configuration>
</plugin>
It might be related to #19945