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… 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… [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…
Settings.xml: <settings xmlns="maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:schemaLocation="maven.apache.org/SETTINGS/1.0.0 maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository/> <interactiveMode/> <offline/> <pluginGroups/> <server> <id>registry.hub.docker.com</id> <username>username</username> <password>password</password> </server> <mirrors/> <proxies/> <profiles/> <activeProfiles/> </settings>
I like writing about technical stuff that I know and learn by implementing it. Java, BigData, and Cloud enthusiast.