Hi,
I'm trying to build a simple Spring Boot Demo Project as a Spring Native Image and run into this error ...
[INFO] <<< spring-boot-maven-plugin:2.5.6:build-image (default-cli) < package @ demo <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:2.5.6:build-image (default-cli) @ demo ---
[INFO] Building image 'docker.io/library/demo:0.0.2-SNAPSHOT'
[INFO]
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 0%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 5%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 6%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 7%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 9%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 11%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 14%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 16%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 19%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 27%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 46%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 57%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 62%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 70%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 79%
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:tiny' 100%
[INFO] > Pulled builder image 'paketobuildpacks/builder@sha256:e437b6165f761636304f52cdee66ba6208f8183176711c32005da0a0fe71cce8'
[INFO] > Pulling run image 'docker.io/paketobuildpacks/run:tiny-cnb' 0%
[INFO] > Pulling run image 'docker.io/paketobuildpacks/run:tiny-cnb' 49%
[INFO] > Pulling run image 'docker.io/paketobuildpacks/run:tiny-cnb' 100%
[INFO] > Pulled run image 'paketobuildpacks/run@sha256:033f7b589dde6dbd3c10b25faf5d9ae759a7b4197209f056d43f3168c80c20e9'
[INFO] > Executing lifecycle version v0.14.1
[INFO] > Using build cache volume 'pack-cache-99cdcec8555c.build'
[INFO]
[INFO] > Running creator
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:51 min
[INFO] Finished at: 2022-08-17T11:21:02Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.6:build-image
(default-cli) on project demo: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.5.6:build-image
failed: Docker API call to 'localhost:2375/v1.24/containers/create'
failed with status code 403 "Forbidden" -> [Help 1]
The start seams promising some downloads are running for the buildpacks ... but then a failure with 403 forbidden.
My bitbucket-pipelines.yml
image: amazoncorretto:17-alpine-jdk
pipelines:
default:
- parallel:
- step:
services:
- docker
caches:
- maven
- docker
name: 'Build and Test'
script:
- export DOCKER_BUILDKIT=1
- docker version
- ./mvnw package spring-boot:build-image
- step:
name: 'Security scan'
script:
- echo "Not implemented yet ;-)"
The "docker version" command is only inserted for testing purposes, this commands works well.
My Spring-Boot Maven POM (snipped) ...
...
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>${repackage.classifier}</classifier>
<image>
<builder>paketobuildpacks/builder:tiny</builder>
<env>
<BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
</env>
</image>
</configuration>
</plugin>
The configuration seems really simple and straightforward from my point of view.
Does anyone have the same experience or suggestions on what to change to make it work ...