Skip to content

dilbertside/spring-mvc-start-archetype-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring MVC Start Maven archetype docker runner

This container is a maven runner to generate a project using the m2 repository packaged in the container for the archetype Spring Web MVC Maven Archetype starter

How to build locally

./publish.sh

to run

Goto one directory which does not contain any pom.xml and run the following

Project generation

docker run -it --rm -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven diside/spring-mvc-start-archetype-docker mvn archetype:generate -DarchetypeGroupId=com.github.dilbertside -DarchetypeArtifactId=spring-mvc-start-archetype -DarchetypeVersion=5.1.10

Generated project compilation, test

cd <your-project>
docker run -it --rm -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven diside/spring-mvc-start-archetype-docker:latest sh -c "mvn -q clean package test -Ptest && ls target"

Build Docker images with Google JIB project

cd <your-project>
docker run -it --rm -v "$(pwd)":/usr/src/mymaven -v /var/run/docker.sock:/var/run/docker.sock -w /usr/src/mymaven diside/spring-mvc-start-archetype-docker:latest sh -c "mvn compile -Dimage=diside/webapp:0.0.1 jib-maven-plugin:dockerBuild"

change diside/webapp:0.0.1 with your own docker registry and naming convention.