Build image failed w/o a clear error message with Maven plugin v0.9.7
See original GitHub issueDescription of the issue: Build image failed w/o a clear error message with Maven plugin v0.9.7
Expected behaviour: An image is built and pushed to Docker hub.
Steps to reproduce:
- Set up docker hub credentials in Maven’s
settings.xml
- Run
mvn compile jib:build
in the project root
Environment:
- Windows 10
- Maven 3.5.3
- Oracle JDK 1.8.0_172
jib-maven-plugin
Configuration:
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.plagov</groupId>
<artifactId>jib-docker-demo</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>0.9.7</version>
<configuration>
<to>
<image>registry.hub.docker.com/vplagov/image-built-with-jib</image>
</to>
</configuration>
</plugin>
</plugins>
</build>
</project>
Configuration in settings.xml
:
<settings>
...
<servers>
<server>
<id>registry.hub.docker.com</id>
<username>my_username</username>
<password>my_password</password>
</server>
</servers>
...
</settings>
Log output: full output after I run mvn compile jib:build
command:
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< io.plagov:jib-docker-demo >----------------------
[INFO] Building jib-docker-demo 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jib-docker-demo ---
[WARNING] Using platform encoding (Cp1257 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ jib-docker-demo ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1257, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\vitali.plagov\IdeaProjects\jib-docker-demo\target\classes
[INFO]
[INFO] --- jib-maven-plugin:0.9.7:build (default-cli) @ jib-docker-demo ---
[WARNING] Base image 'gcr.io/distroless/java' does not use a specific image digest - build may not be reproducible
[INFO]
[INFO] Containerizing application to vplagov/image-built-with-jib...
[INFO]
[INFO] Retrieving registry credentials for registry.hub.docker.com...
[INFO] Getting base image gcr.io/distroless/java...
[INFO] Building dependencies layer...
[INFO] Building resources layer...
[INFO] Building classes layer...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.735 s
[INFO] Finished at: 2018-07-26T09:27:02+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.7:build (default-cli) on project jib-docker-demo: Build image failed: C:\Users\vitali.plagov\IdeaProjects\jib-docker-demo\target\jib-cache\5063664208194952830.tmp -> C:\Users\vitali.plagov\IdeaProjects\jib-docker-demo\target\jib-cache\252a131556a09f39f95d58172fca18c51b4ba688a9c29b0fc1bdd118f8e9abb2.tar.gz -> [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/MojoExecutionException
Additional Information: I tried with several other versions, like 0.9.0, 0.9.4 and 0.9.7. Unfortunatelly, still more or less the same output. Also, the day before I’ve managed to build an image and push it to Docker hub. I got an error with an authentication when I encrypted the password with Maven, but after I put my DockerID password in a plain text, then I’ve succesfully built and pushed an image.
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (11 by maintainers)
Top Results From Across the Web
Error while building docker image, Failed to execute goal org ...
I did a mistake in the image tag. image name should be part of name tag. After correcting the image tag in pom.xml,...
Read more >Maven Getting Started Guide
apache.maven.plugins is the designated groupId for all Maven plugins. artifactId This element indicates the unique base name of the primary artifact being ...
Read more >Build failing on 2.8.0-SNAPSHOT - Google Groups
[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.7.0:compile (default) on project app: Failed to resolve artifact: 1 problem was ...
Read more >fabric8io/docker-maven-plugin
This is a Maven plugin for managing Docker images and containers. It focuses on two major aspects for a Docker build integration:.
Read more >Solved: Maven Build Error - Could not transfer artifact co...
I had installed the certificate via keytool -import for content-package-plugin. Then taking new built gave below error :- [ERROR] Failed to execute goal...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I wondered that too, but we could hit it if we have two layers with the same file contents (e.g., pulling a base image that had such a layer). So I think it’s still possible, just a little less likely.
@briandealwis Nope! This was fixed in #622 and will be available in version
0.9.8
.