Skip to content

SoluReal/spring-boot-docker-image

Repository files navigation

Different ways of building images for Spring Boot applications

In this repository you will find the source code for the blog posts:

Dockerfiles:

docker build -t spring-demo-distroless .
docker build -t spring-demo-distroless-debug -f Dockerfile-debug .
  • Dockerfile-jdk: bellsoft/liberica-openjre-alpine:17 based image that contains only a JRE for a smaller image.
docker build -t spring-demo-jre -f Dockerfile-jdk .

To build the image with buildpacks:

./gradlew bootBuildImage

Image size

See the image size of the images build:

docker images | grep spring-demo