---
title: "Comment by Senthilkumar on \"Containerizing Spring Boot Application with Jib\" | Hashnode"
description: "Really Thanks Ashish for sharing about Jib!! Really its helpful!! When i done the similar kind of setup in my machine and getting the below error when i execute"
url: "https://hashnode.com/posts/containerizing-spring-boot-application-with-jib/5fd088057b097d34759e922c/comment/606c235b1ed1783ab063755e"
---

[Discussion](https://hashnode.com/posts/containerizing-spring-boot-application-with-jib/5fd088057b097d34759e922c)

Comment [Containerizing Spring Boot Application with Jib](https://hashnode.com/posts/containerizing-spring-boot-application-with-jib/5fd088057b097d34759e922c)

[Senthilkumar](https://hashnode.com/@senthil131720)

[Apr 6, 2021](https://hashnode.com/posts/containerizing-spring-boot-application-with-jib/5fd088057b097d34759e922c/comment/606c235b1ed1783ab063755e)

Really Thanks Ashish for sharing about Jib!! Really its helpful!!

When i done the similar kind of setup in my machine and getting the below error when i execute mvn compile jib:build command. Can you please help me?

Error: D:\\Senthil\\Java\\spring-jib\\spring-jib>mvn compile jib:build \[WARNING\] \[WARNING\] Some problems were encountered while building the effective settings \[WARNING\] Unrecognised tag: 'server' (position: START\_TAG seen ...<pluginGroups/>\\r\\n <server>... @7:15) @ C:\\Users\\tssen.m2\\settings.xml, line 7, column 15 \[WARNING\] \[INFO\] Scanning for projects... \[INFO\] \[INFO\] -----------------------< com.example:spring-jib >----------------------- \[INFO\] Building spring-jib 0.0.1-SNAPSHOT \[INFO\] --------------------------------\[ war \]--------------------------------- \[INFO\] \[INFO\] --- maven-resources-plugin:3.2.0:resources (default-resources) @ spring-jib --- \[INFO\] Using 'UTF-8' encoding to copy filtered resources. \[INFO\] Using 'UTF-8' encoding to copy filtered properties files. \[INFO\] Copying 1 resource \[INFO\] Copying 0 resource \[INFO\] \[INFO\] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ spring-jib --- \[INFO\] Nothing to compile - all classes are up to date \[INFO\] \[INFO\] --- jib-maven-plugin:2.7.1:build (default-cli) @ spring-jib --- \[WARNING\] mainClass, extraClasspath, jvmFlags, and expandClasspathDependencies are ignored for WAR projects \[INFO\] \[INFO\] Containerizing application to registry.hub.docker.com/hiashish/spring-boot-jib-image... \[ERROR\] I/O error for image \[registry.hub.docker.com/hiashish/spring-boot-jib-image\]: \[ERROR\] java.net.SocketException \[ERROR\] Socket Closed \[ERROR\] I/O error for image \[registry.hub.docker.com/hiashish/spring-boot-jib-image\]: \[ERROR\] java.net.SocketException \[ERROR\] Socket Closed \[INFO\] Executing tasks: \[INFO\] \[=============== \] 50.0% complete \[INFO\] > scheduling building manifests \[INFO\] > launching layer pushers \[INFO\] > scheduling pushing container configurations \[INFO\] \[INFO\] ------------------------------------------------------------------------ \[INFO\] BUILD FAILURE \[INFO\] ------------------------------------------------------------------------ \[INFO\] Total time: 14.601 s \[INFO\] Finished at: 2021-04-06T14:21:34+05:30 \[INFO\] ------------------------------------------------------------------------ \[ERROR\] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.7.1:build (default-cli) on project spring-jib: Build image failed, perhaps you should make sure your credentials for 'registry.hub.docker.com/hiashish/spring-boot-jib-image' are set up correctly. See [github.com/GoogleContainerTools/jib/blob/master/d…](https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#what-should-i-do-when-the-registry-responds-with-unauthorized) for help: Unauthorized for registry.hub.docker.com/hiashish/spring-boot-jib-image: 401 Unauthorized \[ERROR\] HEAD [registry.hub.docker.com/v2/hiashish/spring-boot-j…](https://registry.hub.docker.com/v2/hiashish/spring-boot-jib-image/blobs/sha256:3bb6e0856b81a5b7eb18584843266c2c7bb0377054645660999d0e7ae54f773e) \[ERROR\] -> \[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\] [cwiki.apache.org/confluence/display/MAVEN/MojoExe…](http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException)

Settings.xml: <settings xmlns="[maven.apache.org/SETTINGS/1.0.0"](http://maven.apache.org/SETTINGS/1.0.0%22) xmlns:xsi="[w3.org/2001/XMLSchema-instance"](http://www.w3.org/2001/XMLSchema-instance%22) xsi:schemaLocation="[maven.apache.org/SETTINGS/1.0.0](http://maven.apache.org/SETTINGS/1.0.0) [maven.apache.org/xsd/settings-1.0.0.xsd">](https://maven.apache.org/xsd/settings-1.0.0.xsd%22%3E) <localRepository/> <interactiveMode/> <offline/> <pluginGroups/> <server> <id>registry.hub.docker.com</id> <username>username</username> <password>password</password> </server> <mirrors/> <proxies/> <profiles/> <activeProfiles/> </settings>

[Senthilkumar](https://hashnode.com/@senthil131720)

[Apr 6, 2021](https://hashnode.com/posts/containerizing-spring-boot-application-with-jib/5fd088057b097d34759e922c/comment/606c235b1ed1783ab063755e#reply-606c28001ed1783ab06375c4)

Hi Ashish,

I have created test account in Docker Registry. However, still getting below error. Please suggest.

Build image failed, perhaps you should make sure your credentials for 'registry.hub.docker.com/senthil131720/spring-boot-jib-image' are set up correctly

[Ashish Choudhary](https://hashnode.com/@iashish)

[Apr 6, 2021](https://hashnode.com/posts/containerizing-spring-boot-application-with-jib/5fd088057b097d34759e922c/comment/606c235b1ed1783ab063755e#reply-606c37b4b17dc439b747e998)

Hi, Thanks for reading my blog. Now coming back to your issue, well, the problem with the first error is that you are using my docker hub registry URL in your build, so it will not work as you don't have credentials for that. The correct way is the create your Docker Hub account and then use those login credentials in the maven settings.xml file as mentioned in the blog.

[Senthilkumar](https://hashnode.com/@senthil131720)

[Apr 6, 2021](https://hashnode.com/posts/containerizing-spring-boot-application-with-jib/5fd088057b097d34759e922c/comment/606c235b1ed1783ab063755e#reply-606c39c41ed1783ab0637758)

Thanks Ashish for quick reply!

Now connection timeout issue has been resolved.

\[INFO\] Nothing to compile - all classes are up to date \[INFO\] \[INFO\] --- jib-maven-plugin:2.7.1:build (default-cli) @ spring-jib --- \[WARNING\] mainClass, extraClasspath, jvmFlags, and expandClasspathDependencies are ignored for WAR projects \[INFO\] \[INFO\] Containerizing application to senthil131720/demo... \[WARNING\] Base image 'gcr.io/distroless/java:11' does not use a specific image digest - build may not be reproducible \[INFO\] Using credentials from <to><auth> for senthil131720/demo \[INFO\] Using base image with digest: sha256:30fb7dce6b07bc81b23cdf2142cbf06e75529bd9189371e0ea39a7cf8ee09191 \[INFO\] \[INFO\] Container entrypoint set to \[/usr/bin/java, -jar\] (inherited from base image) \[INFO\] \[INFO\] Built and pushed image as senthil131720/demo \[INFO\] Executing tasks: \[INFO\] \[==============================\] 100.0% complete \[INFO\] \[INFO\] ------------------------------------------------------------------------ \[INFO\] BUILD SUCCESS \[INFO\] ------------------------------------------------------------------------ \[INFO\] Total time: 04:19 min \[INFO\] Finished at: 2021-04-06T15:48:57+05:30 \[INFO\] ------------------------------------------------------------------------

However, when i access [localhost/hello](http://localhost:8080/hello) its giving below error

D:\\Senthil\\Java\\spring-jib\\spring-jib>curl localhost:8080/hello {"timestamp":"2021-04-06T10:19:52.588+00:00","status":404,"error":"Not Found","message":"","path":"/hello"}

SpringBoot container started and running in http 8080 port not sure why i still cant access the endpoint.

Please advise Ashish

Thanks again

[Senthilkumar](https://hashnode.com/@senthil131720)

[Apr 6, 2021](https://hashnode.com/posts/containerizing-spring-boot-application-with-jib/5fd088057b097d34759e922c/comment/606c235b1ed1783ab063755e#reply-606c3dd6b17dc439b747ea07)

Hi Ashish,

Moreover, despite configuring docker hub username and password in maven settings.xml file, we need to explicitly pass username and password when we executing build jib command. Please advise. Thanks again

mvn compile jib:build -Djib.to.auth.username=user -Djib.to.auth.password=pass

[Ashish Choudhary](https://hashnode.com/@iashish)

[Apr 6, 2021](https://hashnode.com/posts/containerizing-spring-boot-application-with-jib/5fd088057b097d34759e922c/comment/606c235b1ed1783ab063755e#reply-606c4d561ed1783ab06378ea)

[Senthilkumar](https://hashnode.com/@senthil131720) Do you mind sharing the docker run command you have used to start the container?.

[Ashish Choudhary](https://hashnode.com/@iashish)

[Apr 6, 2021](https://hashnode.com/posts/containerizing-spring-boot-application-with-jib/5fd088057b097d34759e922c/comment/606c235b1ed1783ab063755e#reply-606c4f341ed1783ab06378f4)

[Senthilkumar](https://hashnode.com/@senthil131720) I have never explicitly passed username and password while running jib:build. You can check the [documentation](https://github.com/GoogleContainerTools/jib/tree/master/jib-maven-plugin#build-your-image) for more details. I have not passed any credentials explicitly in the demo video, so it should pick up from the setttings.xml file.

[Senthilkumar](https://hashnode.com/@senthil131720)

[Apr 6, 2021](https://hashnode.com/posts/containerizing-spring-boot-application-with-jib/5fd088057b097d34759e922c/comment/606c235b1ed1783ab063755e#reply-606c5d88b17dc439b747ecc9)

Hi Ashish,

All setup are done now when i try to execute docker run command using docker run -it --rm -p 8080:8080 senthil131720/demo getting below error. I have installed Docker in my machine. Please advice. Thanks again!

D:\\Senthil\\Java\\spring-jib\\spring-jib>docker run -it --rm -p 8080:8080 senthil131720/demo Error: -jar requires jar file specification Usage: java \[options\] <mainclass> \[args...\] (to execute a class) or java \[options\] -jar <jarfile> \[args...\] (to execute a jar file) or java \[options\] -m <module>\[/<mainclass>\] \[args...\] java \[options\] --module <module>\[/<mainclass>\] \[args...\] (to execute the main class in a module) or java \[options\] <sourcefile> \[args\] (to execute a single source-file program)
