Different ways to dockerize spring-app

jvm-lukas.com 1 rok temu

Introduction

  • Used tool to analyze docker image dive
  • Analyzed SpringBootApp repo

Method 1: Spring Boot Build Plugin

I was actually surprised that Spring Boot and Maven already have docker builder basically build-in into Maven. Plugin uses BuildPack builder which automatically detects SpringBoot app, and then it builds the relevant image for you.

mvn spring-boot:build-image -Dspring-boot.build-image.imageName=hello-jvm:buildPacks

Images are a bit large and not optimized (but that also depends on JDK that you use). In the end all dependencies and compiled application is stored in a single...

Idź do oryginalnego materiału