Auto Push Spring Boot App Image on Docker Hub Repository# 9561826040
In this we will see how to create image and push on docker hub automatically.
I create simple Hello_World_Docker spring boot application and created one controller in it.
package com.example.demo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class WelcomeController {
@RequestMapping("/wish")
public String Wish() {
return "HELLO GVOIND MANTRI";
}
}
command : package dockerfile:build
command : package dockerfile:push
command : clean install
=========================================================================================================================================
Pom.xml plugin
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.13</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>gmantrig/bootapp1</repository>
<tag>11.8</tag>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
</configuration>
</plugin>
</plugins>
============================================================================================================================================
settings.xml m2 folder dockerhiub username password
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>docker.io</id>
<username>gmantrig</username>
<password>Perfect@12345</password>
</server>
</servers>
<pluginGroups>
<pluginGroup>com.spotify</pluginGroup>
</pluginGroups>
</settings>
--------------------------------------------------------------------------------------------------------------------------------------------
windows - prefrances - maven settings check properly
Comments
Post a Comment