Docker image that contains maven with lots of dependencies for spring boot projects.
531
Docker image that contains maven with lots of dependencies for spring boot projects. This should increase build speeds dramatically.
This repo contains source to build Docker images that contain maven with lots of spring-boot related dependencies.
This repo is automatically connected to docker hub to build public docker images.
Refer to official maven docker image (usage is the same).
Most common use - run this command from the source of your spring boot source code:
mvn run --rm -v "$PWD":/sourcecode lukastosic/maven-spring-boot:1.5.3.RELEASE-3.5-jdk-8-alpine mvn clean package
Run parameters:
-v "$PWD":/sourcecode - this will map your source code folder inside working directory of docker container
1.5.3.RELEASE-3.5-jdk-8-alpine - this is the tag of docker image. This tag means that image is based on Spring Boot 1.5.3.RELEASE and maven docker image tag 3.5-jdk-8-alpine
mvn clean package - this is just sample mvn command. You can execute any maven command that you want.
This image is built based on exising Maven image Dockerfile.
For specific Spring Boot versions and dependencies it is using generated pom.xml file and file with Main() method that are generated from Spring Initializr.
On Spring Initializr appropriate Spring Boot version is selected.
That pom.xml and source code are placed into Dockerfile to trigger download of all dependencies.
After that source pom.xml and other source files are removed.
Now you have a Docker image that contains maven and all dependencies downloaded for proper Spring Boot build. Any additional dependencies that you use in your software will have to be downloaded, but at least you won't have to re-download the same "basic" Spring Boot dependencies over and over again with every build.
Content type
Image
Digest
Size
165 MB
Last updated
over 9 years ago
docker pull lukastosic/maven-spring-boot