close

Announcing Spring Cloud Stream Horsham.SR2 (3.0.2.RELEASE) and Spring Cloud Hoxton.SR2

We are pleased to announce the release of the Spring Cloud Stream Horsham.SR2 (3.0.2.RELEASE) release train which is available as part of Spring Cloud Hoxton.SR2 (just released) and builds on Spring Boot 2.2.4 and Spring Cloud Function 3.0.2.RELEASE which was also just released.

Spring Cloud Stream Horsham.SR2 modules are available for use in the Maven Central repository.

This release contains several fixes and enhancements primarily driven by user’s feedback, so thank you.
For more details please follow these links:
- Spring Cloud Stream Core
- Spring Cloud Stream Core Rabbit Binder
- Spring Cloud Stream Core Kafka Binder
- Spring Cloud Function

Read more

This Week in Spring - February 18th, 2020

Hi, Spring fans! Welcome to another installment of This Week in Spring! This week I’m off to sunny Atlanta, Georgia, for the epic Devnexus show there. If you’re there, don’t hesitate to reach out and say hi! I’m also busy recording new episodes of a Bootiful Podcast and new Spring Tips videos videos. We have some amazing guests on the show coming up and we have some really fascinating topics to introduce in our Spring Tips videos, too!

Read more

This Week in Spring - February 11th, 2020

Hi, Spring fans! Welcome to yet another installment of This Week in Spring! It’s been a very nice week indeed. I’ve been knee-deep in finishing my book, writing more code to support the A Bootiful Podcast production pipeline, and meeting amazing people in the new VMWare organization, and beyond. I’ve also been working on some new Spring Tips videos - what would you like to see covered, my friends?

We’ve got a lot of good stuff this week, so let’s get to it!

Read more

This Week in Spring - February 4th, 2020

Hi, Spring fans! Welcome to another installment of This Week in Spring! I just finished spending a wonderful afternoon with customers and now I’m pouring through all the wonderful new content for this week. As usual, we’ve got a lot to cover so let’s get to it!

Read more

This Week in Spring - January 28th, 2020

Hi, Spring fans! How’re things, my friends? Can you believe we’re already nearly at the end of January? I have been knee-deep in code and coffee for these last several days and I’m running late for a meeting so, without further ado, let’s get to it!

Read more

Creating Docker images with Spring Boot 2.3.0.M1

Spring Boot 2.3.0.M1 has just been released and it brings with it some interesting new features that can help you package up your Spring Boot application into Docker images. In this blog post we’ll take a look at the typical ways developers create Docker images, and show how they can be improved by using these new features.

Common Docker Techniques

Although it’s always been possible to convert the fat jars produced by Spring Boot into Docker images, it’s pretty easy to make less than optimal results. If you do a web search for "dockerize spring boot app", the chances are high you’ll find an article or blog post suggesting you create a dockerfile that looks something like this:

FROM openjdk:8-jdk-alpine
EXPOSE 8080
ARG JAR_FILE=target/my-application.jar
ADD ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]

Whilst this approach works fine, and it’s nice and concise, there are a few things that are sub-optimal.

The first problem with above file is that the jar file is not unpacked. There’s always a certain amount of overhead when running a fat jar, and in a containerized environment this can be noticeable. It’s generally best to unpack your jar and run in an exploded form.

The second issue with the file is that it isn’t very efficient if you frequently update your application. Docker images are built in layers, and in this case your application and all its dependencies are put into a single layer. Since you probably recompile your code more often than you upgrade the version of Spring Boot you use, it’s often better to separate things a bit more. If you put jar files in the layer before your application classes, Docker often only needs to change the very bottom layer and can pick others up from its cache.

Two new features are introduced in Spring Boot 2.3.0.M1 to help improve on these existing techniques: buildpack support and layered jars.

Read more