Dear Tea, I am using Spring Boot 2.3.1 version. While executing the maven command mvn spring-boot:build-image. I am getting the below error .
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.1.RELEASE:build-image (default-cli) on project Spring-Boot-docker: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.3.1.RELEASE:build-image failed: Builder lifecycle 'creator' failed with status code 3
Thanks, Swastik
Comment From: wilkinsona
Thanks for the report. Can you please provide the complete output of the failing build?
Comment From: scottfrederick
Are you using the default CNB builder or specifying a different builder?
Please provide the Maven command-line you are running and any configuration of the spring-boot-maven-plugin related to image building so we can verify the options you are using.
Comment From: Swastikpadhy
Dear Team, I am a beginner so please guide me if I have made any mistake. I have run the command - mvn spring-boot:build-image -DskipTests=true
Log
Spring-Boot-docker>mvn spring-boot:build-image -DskipTests=true
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< com.example:Spring-Boot-docker >-------------------
[INFO] Building Spring-Boot-docker 0.0.2
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:2.3.1.RELEASE:build-image (default-cli) > package @ Spring-Boot-docker >>>
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ Spring-Boot-docker ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ Spring-Boot-docker ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ Spring-Boot-docker ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Swastik Padhy\Downloads\Spring Boot docker\Spring-Boot-docker\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ Spring-Boot-docker ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ Spring-Boot-docker ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ Spring-Boot-docker ---
[INFO] Building jar: C:\Users\Swastik Padhy\Downloads\Spring Boot docker\Spring-Boot-docker\target\Spring-Boot-docker-0.0.2.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.3.1.RELEASE:repackage (repackage) @ Spring-Boot-docker ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.3.1.RELEASE:build-image (default-cli) < package @ Spring-Boot-docker <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:2.3.1.RELEASE:build-image (default-cli) @ Spring-Boot-docker ---
[INFO] Building image 'docker.io/library/Spring-Boot-docker:0.0.2'
[INFO]
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 0%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 4%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 9%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 12%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 17%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 21%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 27%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 31%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 36%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 41%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 45%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 49%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 52%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 57%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 62%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 66%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 69%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 73%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 75%
[INFO] > Pulling builder image 'gcr.io/paketo-buildpacks/builder:base-platform-api-0.3' 100%
[INFO] > Pulled builder image 'gcr.io/paketo-buildpacks/builder@sha256:f15437f4a37d98aaf98b5777c378a24796f9c18718a7584afe4b8e83d74c1151'
[INFO] > Pulling run image 'gcr.io/paketo-buildpacks/run:base-cnb' 100%
[INFO] > Pulled run image 'gcr.io/paketo-buildpacks/run@sha256:f7f27462fb513a70370322ada08440a642d24a700056d4c6b8cbb344610bf486'
[INFO] > Executing lifecycle version v0.8.0
[INFO] > Using build cache volume 'pack-cache-d8d13cf2f1af.build'
[INFO]
[INFO] > Running creator
[INFO] [creator] ERROR: failed to validate image tag(s): could not parse reference: docker.io/library/Spring-Boot-docker:0.0.2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:22 min
[INFO] Finished at: 2020-06-16T23:14:10+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.3.1.RELEASE:build-image (default-cli) on project Spring-Boot-docker: Execution d
efault-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.3.1.RELEASE:build-image failed: Builder lifecycle 'creator' failed with status code 3 -> [He
lp 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>Spring-Boot-docker</artifactId>
<version>0.0.2</version>
<name>Spring-Boot-docker</name>
<description>Demo project for Spring Boot docker</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-image</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Thanks
Comment From: scottfrederick
I am a beginner so please guide me if I have made any mistake.
This additional information is exactly what we needed to figure out what's wrong. Thank you for the details.
The line of output that points to the problem is here:
[INFO] [creator] ERROR: failed to validate image tag(s): could not parse reference: docker.io/library/Spring-Boot-docker:0.0.2
Docker image names are not allowed to have upper-case characters, so the name Spring-Boot-docker is invalid. If you replace that with spring-boot-docker it will likely work. The plugin documentation has an example of customizing the name of the resulting image.
We have an issue to validate the image reference before passing it to the builder so we can give a better error message in cases like this. I'll close this issue as a duplicate of #21495.
Comment From: Swastikpadhy
@scottfrederick : Thanks a ton.
I appreciate all your guidance. Thanks again
Regards, Swastik
Comment From: SabeloShabalala
Hi there,
When I try to run mvn spring-boot:build-image -DskipTest I get the below error:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.0:build-image (default-cli) on project currency-exchange-service: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.5.0:build-image failed: Builder lifecycle 'creator' failed with status code 145
Please assist, I'm also still new on docker.
Comment From: scottfrederick
@SabeloShabalala As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Please post your question to Stack Overflow and include the full output of the Maven build command.
Comment From: HarikrishnaThopugunta
Hello Team, I am also beginner to docker world, I am getting below error.
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.460 s
[INFO] Finished at: 2022-11-02T09:42:58Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.0:build-image (default-cli) on project currency-exchange-service: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.5.0:build-image failed: Builder lifecycle 'creator' failed with status code 145 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Please guide me where I am doing somemistake.
Thanks..
Comment From: wilkinsona
@HarikrishnaThopugunta Please take a moment to read the other comments in the issue, particularly the two comments immediately above yours. Also, please note that Spring Boot 2.5 is no longer supported. You should upgrade to 2.6.x or 2.7.x as soon as possible.