0

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?

2 Answers 2

0

I'm not sure why the builder you're using triggers this error ("Request to write '16384' bytes exceeds size in header of '101246' bytes") BUT I believe this builder to be deprecated; just look at its github page: https://github.com/paketo-buildpacks/builder

I suggest you move to supported Paketo Buildpacks Builders, such as:

$ pack builders suggest
Suggested builders:
    [...]
    Paketo Buildpacks:     paketobuildpacks/builder-jammy-base                     Ubuntu 22.04 Jammy Jellyfish base image with buildpacks for Java, Go, .NET Core, Node.js, Python, Apache HTTPD, NGINX and Procfile
    Paketo Buildpacks:     paketobuildpacks/builder-jammy-buildpackless-static     Static base image (Ubuntu Jammy Jellyfish build image, distroless-like run image) with no buildpacks included. To use, specify buildpacks at build time.
    Paketo Buildpacks:     paketobuildpacks/builder-jammy-full                     Ubuntu 22.04 Jammy Jellyfish full image with buildpacks for Apache HTTPD, Go, Java, Java Native Image, .NET, NGINX, Node.js, PHP, Procfile, Python, and Ruby
    Paketo Buildpacks:     paketobuildpacks/builder-jammy-tiny                     Tiny base image (Ubuntu Jammy Jellyfish build image, distroless-like run image) with buildpacks for Java, Java Native Image and Go

and report any error either on StackOverflow like you did, or any of those means:

Sign up to request clarification or add additional context in comments.

Comments

0

I just fixed this same issue on a MacBook by picking the default builder instead of full-cf.

The problem is that the MacBook has 8 Gb of RAM only, which does not seem enough to build an image based on full-cf. Make sure you have plenty of RAM available for docker to build large images.

Hope this helps!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.