Creating Efficient Docker Images with Spring Boot 2.3

Creating Efficient Docker Images with Spring Boot 2.3

This is an update to the original blog post about creating docker images with Spring Boot 2.3. There were a few things related to image creation that changed between the first milestone of Spring Boot 2.3 and the GA release.

This is an update to the original blog post about  creating docker images with Spring Boot 2.3.

There were a few things related to image creation that changed between the first milestone of Spring Boot 2.3 and the GA release.

The two new features introduced in Spring Boot 2.3 to help improve image creation techniques were: layered jars and buildpack support.

Layered Jars

The layered jar feature evolved quite a bit as we started adding support for custom layers. While the need to express layers that the jar should be split into for image creation was evident, changing the format of the jar to do so no longer seemed necessary.

Spring Boot 2.3 includes support for layering a jar using a layers.idx file. The layers index file provides a list of layers and the parts of the jar that should be contained within them. Layers are written in the order that they should be added to the Docker/OCI image.

By default, the following layers are defined:

  • dependencies for any dependency whose version does not contain SNAPSHOT.
  • spring-boot-loader for the jar loader classes.
  • snapshot-dependencies for any dependency whose version contains SNAPSHOT.
  • application for application classes and resources.

docker spring boot 2.3 spring boot

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Spring Boot 2.3.2 available now

On behalf of the team and everyone who has contributed, I’m happy to announce that Spring Boot 2.3.2 has been released and is now available from repo.spring.io and Maven Central. This release includes 88 bug fixes, enhancements, documentation improvements, and dependency upgrades. Thanks to all those who have contributed with issue reports and pull requests.

Build and Deploy a Spring Boot App on Kubernetes | spring Boot Docker Kubernetes

You will learn how to deploy a Java 11 Spring Boot application on a Kubernetes cluster and how to build and deploy a spring boot application on kubernetes us...

Deploying Spring Boot and MongoDB as Containers Using Docker and Docker Compose

In this video you will learn how to Dockerize spring boot with mongodb and Dockerize a Spring Boot with mongodb using docker-compose in ubuntu mahcine. GitHu...

Create Layered Jars & Layered Docker images with Spring Boot 2.3

In this video, You will learn how to create layered jars and layered spring boot docker image by using Spring Boot 2.3.0 and will learn how to use these layers in side multistage docker file.

Spring Boot 2.3 enhances Docker support with new features

Spring Boot version 2.3 is here and it includes a long list of dependency upgrades, an update for Spring Data, Docker support additions and more.