I have a Spring Boot project. When I run
mvnw spring-boot:build-image it fails with following error:
[INFO] <<< spring-boot:3.1.12:build-image (default-cli) < package @ perftest <<<
[INFO]
[INFO]
[INFO] --- spring-boot:3.1.12:build-image (default-cli) @ perftest ---
[INFO] Building image 'docker.io/library/perftest:0.0.1-SNAPSHOT'
[INFO]
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:full-cf' 100%
[INFO] > Pulled builder image 'gcr.io/paketo-buildpacks/builder@sha256:afaf972de6965ff45d2663fe1dc86bd684ccf3c62a2c87a3ad7c2dda9010c295'
[INFO] > Pulling run image 'docker.io/paketobuildpacks/run:full-cnb' 100%
[INFO] > Pulled run image 'paketobuildpacks/run@sha256:5373ba74412664ac24f132e29b94808467d8522e5f79557d5aea72571c15e7fe'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.702 s
[INFO] Finished at: 2025-01-06T14:30:45+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.1.12:build-image (default-cli) on project perftest: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.1.12:build-image failed: Connection to the Docker daemon at 'localhost' failed with error "Request to write '16384' bytes exceeds size in header of '101246' bytes for entry 'a3c8883a9aacac6989b90547760c0fd13980db4da255df02c67187d1f7fe6b1b.json'"; ensure the Docker daemon is running and accessible -> [Help 1]
I found out, that it happens only if a builder in pom.xml is set to gcr.io/paketo-buildpacks/builder:full-cf:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<builder>gcr.io/paketo-buildpacks/builder:full-cf</builder>
</image>
</configuration>
</plugin>
If the builder configuration is omitted, i.e. default builder is used, the build succeed. However I need fonts to be included in the target image, so I'm using full-cf builder.
In my other project, when never Spring Boot 3.3.7 is used, it behaves same. I got this error:
[INFO] <<< spring-boot:3.3.7:build-image (default-cli) < package @ portal <<<
[INFO]
[INFO]
[INFO] --- spring-boot:3.3.7:build-image (default-cli) @ portal ---
[INFO] Building image 'docker.io/library/portal:2025.2-SNAPSHOT'
[INFO]
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:full-cf' 100%
[INFO] > Pulled builder image 'gcr.io/paketo-buildpacks/builder@sha256:afaf972de6965ff45d2663fe1dc86bd684ccf3c62a2c87a3ad7c2dda9010c295'
[INFO] > Pulling run image 'docker.io/paketobuildpacks/run:full-cnb' 100%
[INFO] > Pulled run image 'paketobuildpacks/run@sha256:5373ba74412664ac24f132e29b94808467d8522e5f79557d5aea72571c15e7fe'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.427 s
[INFO] Finished at: 2025-01-06T14:26:35+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.3.7:build-image (default-cli) on project portal: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.3.7:build-image failed: Connection to the Docker daemon at '//./pipe/docker_engine' failed with error "Request to write '16384' bytes exceeds size in header of '101244' bytes for entry '4ce5e26433d74237ef6e04fbeb92fec672abf398d05f4e81258bb0fbeb510295.json'"; ensure the Docker daemon is running and accessible -> [Help 1]
I'm using Windows with WSL 2 and latest Docker. The Docker is configured to use the WSL 2 engine.
I tested the image build on two other systems and it works as expected (no errors).
Any idea what's wrong on my system?