SlideShare a Scribd company logo
1 of 41
@barecode @gcharters#Devoxx #Boost
Optimizing Spring Boot apps
for Docker
Michael Thompson
Senior Software Engineer, IBM
@barecode
Graham Charters
STSM, IBM
@gcharters
Community Party @ Devoxx.be 2018
Continue the conversation
Join us on Wednesday November 14 at 19:00!
Register here:
http://ibm.biz/IBMDEVOXXBELGIUM
Kelly's Irish Pub
De Keyserlei 27
B-2018 Antwerp
@barecode @gcharters#Devoxx #Boost
Spring Boot Dockerfile
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Dockerfile
https://spring.io/guides/gs/spring-boot-docker/
@barecode @gcharters#Devoxx #Boost
Spring Boot Dockerfile
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
It works …
So what’s wrong with it?
¯_(ツ)_/¯
Dockerfile
https://spring.io/guides/gs/spring-boot-docker/
@barecode @gcharters#Devoxx #Boost
Docker 101
@barecode @gcharters#Devoxx #Boost
Docker 101 (only the relevant bits)
@barecode @gcharters#Devoxx #Boost
Dockerfile & build
Dockerfile
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
https://spring.io/guides/gs/spring-boot-docker/
docker build -t spring-petclinic:devoxx 
--build-arg JAR_FILE=target/spring-petclinic.jar .
@barecode @gcharters#Devoxx #Boost
Image dependency
Dockerfile
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
https://spring.io/guides/gs/spring-boot-docker/
docker build -t spring-petclinic:devoxx 
--build-arg JAR_FILE=target/spring-petclinic.jar .
@barecode @gcharters#Devoxx #Boost
Image layers
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Dockerfile
https://spring.io/guides/gs/spring-boot-docker/
docker build -t spring-petclinic:devoxx 
--build-arg JAR_FILE=target/spring-petclinic.jar .
@barecode @gcharters#Devoxx #Boost
Image name
Dockerfile
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
https://spring.io/guides/gs/spring-boot-docker/
docker build -t spring-petclinic:devoxx 
--build-arg JAR_FILE=target/spring-petclinic.jar .
@barecode @gcharters#Devoxx #Boost
Docker layer considerations
•What you FROM has a huge influence on your image
•Layers are cached
•Any change to a layer rebuilds all layers that depend on them
•Deleting things from lower layers doesn’t make things
smaller
@barecode @gcharters#Devoxx #Boost
Back To The First Question
@barecode @gcharters#Devoxx #Boost
Spring Boot Dockerfile
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Dockerfile
https://spring.io/guides/gs/spring-boot-docker/
It works …
So what’s wrong with it?
¯_(ツ)_/¯
@barecode @gcharters#Devoxx #Boost
Technically Nothing…
@barecode @gcharters#Devoxx #Boost
But Let’s Look At The Layers
@barecode @gcharters#Devoxx #Boost
Spring Boot Dockerfile - JAR
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Dockerfile
https://spring.io/guides/gs/spring-boot-docker/
docker build -t spring-petclinic:devoxx 
--build-arg JAR_FILE=target/spring-petclinic.jar .
@barecode @gcharters#Devoxx #Boost
🔥 Live Code 🔥
Let’s Do a Build
https://github.com/barecode/spring-petclinic
branch: docker-jar
https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md
@barecode @gcharters#Devoxx #Boost
Spring Boot Dockerfile - JAR
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Dockerfile
https://spring.io/guides/gs/spring-boot-docker/
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
spring-petclinic latest e514264e73de 37 seconds ago 141MB
@barecode @gcharters#Devoxx #Boost
Spring Boot Dockerfile - JAR
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Dockerfile
$ docker history spring-petclinic
IMAGE CREATED CREATED BY SIZE COMMENT
e514264e73de 45 seconds ago /bin/sh -c #(nop) ENTRYPOINT ["java" "-Djav… 0B
74b8516987f9 46 seconds ago /bin/sh -c #(nop) COPY file:b13fc8e4506f482f… 38.7MB
ad9202208add 3 minutes ago /bin/sh -c #(nop) ARG JAR_FILE 0B
27aef1178da6 3 weeks ago /bin/sh -c #(nop) VOLUME [/tmp] 0B
54ae553cb104 7 weeks ago /bin/sh -c set -x && apk add --no-cache o… 98.2MB
<missing> 7 weeks ago /bin/sh -c #(nop) ENV JAVA_ALPINE_VERSION=8… 0B
<missing> 7 weeks ago /bin/sh -c #(nop) ENV JAVA_VERSION=8u171 0B
<missing> 7 weeks ago /bin/sh -c #(nop) ENV PATH=/usr/local/sbin:… 0B
<missing> 7 weeks ago /bin/sh -c #(nop) ENV JAVA_HOME=/usr/lib/jv… 0B
<missing> 7 weeks ago /bin/sh -c { echo '#!/bin/sh'; echo 'set… 87B
<missing> 7 weeks ago /bin/sh -c #(nop) ENV LANG=C.UTF-8 0B
<missing> 7 weeks ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0B
<missing> 7 weeks ago /bin/sh -c #(nop) ADD file:25c10b1d1b41d46a1… 4.41MB
Your classes
are in here!
@barecode @gcharters#Devoxx #Boost
You Don’t Have 38MB Of Classes
@barecode @gcharters#Devoxx #Boost
Spring Boot Dockerfile - Classpath
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"]
Dockerfile
https://spring.io/guides/gs/spring-boot-docker/
docker build -t spring-petclinic:classpath .
@barecode @gcharters#Devoxx #Boost
🔥 Live Code 🔥
Let’s Do Different a Build
https://github.com/barecode/spring-petclinic
branch: docker-classpath
https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md
@barecode @gcharters#Devoxx #Boost
Spring Boot Dockerfile - Classpath
Dockerfile
https://spring.io/guides/gs/spring-boot-docker/
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
spring-petclinic latest 735d2848b9b1 14 seconds ago 142MB
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"]
@barecode @gcharters#Devoxx #Boost
Spring Boot Dockerfile - Classpath
Dockerfile
$ docker history spring-petclinic
IMAGE CREATED CREATED BY SIZE COMMENT
735d2848b9b1 14 seconds ago /bin/sh -c #(nop) ENTRYPOINT ["java" "-cp" … 0B
ef9fb7cfff1e 14 seconds ago /bin/sh -c #(nop) COPY dir:ee4babbd63b94fe3c… 988kB
d4d764183900 14 seconds ago /bin/sh -c #(nop) COPY dir:fa853b6962840dbef… 8.35kB
0d4350ccc4f3 15 seconds ago /bin/sh -c #(nop) COPY dir:0ea2765e5f62ee97e… 38.3MB
6d9191a8b48d 2 minutes ago /bin/sh -c #(nop) ARG DEPENDENCY=target/ 0B
27aef1178da6 3 weeks ago /bin/sh -c #(nop) VOLUME [/tmp] 0B
54ae553cb104 7 weeks ago /bin/sh -c set -x && apk add --no-cache o… 98.2MB
<missing> 7 weeks ago /bin/sh -c #(nop) ENV JAVA_ALPINE_VERSION=8… 0B
...
<missing> 8 weeks ago /bin/sh -c #(nop) ADD file:25c10b1d1b41d46a1… 4.41MB
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"]
@barecode @gcharters#Devoxx #Boost
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"]
Spring Boot Dockerfile - Classpath
Dockerfile
These are
your classes!$ docker history spring-petclinic
IMAGE CREATED CREATED BY SIZE COMMENT
735d2848b9b1 14 seconds ago /bin/sh -c #(nop) ENTRYPOINT ["java" "-cp" … 0B
ef9fb7cfff1e 14 seconds ago /bin/sh -c #(nop) COPY dir:ee4babbd63b94fe3c… 988kB
d4d764183900 14 seconds ago /bin/sh -c #(nop) COPY dir:fa853b6962840dbef… 8.35kB
0d4350ccc4f3 15 seconds ago /bin/sh -c #(nop) COPY dir:0ea2765e5f62ee97e… 38.3MB
6d9191a8b48d 2 minutes ago /bin/sh -c #(nop) ARG DEPENDENCY=target/ 0B
27aef1178da6 3 weeks ago /bin/sh -c #(nop) VOLUME [/tmp] 0B
54ae553cb104 7 weeks ago /bin/sh -c set -x && apk add --no-cache o… 98.2MB
<missing> 7 weeks ago /bin/sh -c #(nop) ENV JAVA_ALPINE_VERSION=8… 0B
...
<missing> 8 weeks ago /bin/sh -c #(nop) ADD file:25c10b1d1b41d46a1… 4.41MB
@barecode @gcharters#Devoxx #Boost
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"]
Your Classes Should Be a Leaf!
Dockerfile
These are
your classes!$ docker history spring-petclinic
IMAGE CREATED CREATED BY SIZE COMMENT
735d2848b9b1 14 seconds ago /bin/sh -c #(nop) ENTRYPOINT ["java" "-cp" … 0B
ef9fb7cfff1e 14 seconds ago /bin/sh -c #(nop) COPY dir:ee4babbd63b94fe3c… 988kB
d4d764183900 14 seconds ago /bin/sh -c #(nop) COPY dir:fa853b6962840dbef… 8.35kB
0d4350ccc4f3 15 seconds ago /bin/sh -c #(nop) COPY dir:0ea2765e5f62ee97e… 38.3MB
6d9191a8b48d 2 minutes ago /bin/sh -c #(nop) ARG DEPENDENCY=target/ 0B
27aef1178da6 3 weeks ago /bin/sh -c #(nop) VOLUME [/tmp] 0B
54ae553cb104 7 weeks ago /bin/sh -c set -x && apk add --no-cache o… 98.2MB
<missing> 7 weeks ago /bin/sh -c #(nop) ENV JAVA_ALPINE_VERSION=8… 0B
...
<missing> 8 weeks ago /bin/sh -c #(nop) ADD file:25c10b1d1b41d46a1… 4.41MB
@barecode @gcharters#Devoxx #Boost
Layers Matter
• Faster builds (cache re-use)
• Faster deployents (less bits to push)
• Less wasted Docker repository space (reduced storage costs)
Step 1/7 : FROM openjdk:8-jdk-alpine
---> bf2da8bc5a91
...
Step 4/7 : COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
---> Using cache
---> 76b7fe6ee7f7
The right layers matter …
@barecode @gcharters#Devoxx #Boost
How Do I Get There?
Let boost-maven-plugin help you
<plugin>
<groupId>io.openliberty.boost</groupId>
<artifactId>boost-maven-plugin</artifactId>
<version>0.1.2</version>
<configuration>
<dockerizer>[jar|classpath]</dockerizer>
</configuration>
</plugin>
pom.xml
The right layers matter …
$ mvn boost:docker-build
@barecode @gcharters#Devoxx #Boost
Review
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"]
Dockerfile - Classpath
https://spring.io/guides/gs/spring-boot-docker/
Dockerfile - JAR
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
The right layers matter …
@barecode @gcharters#Devoxx #Boost
Review
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"]
Dockerfile - Classpath
https://spring.io/guides/gs/spring-boot-docker/
Dockerfile - JAR
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Simple but inefficie
nt for CI/CD
A bit more complex, but optim
al for iterative development
The right layers matter …
@barecode @gcharters#Devoxx #Boost
Where You’re FROM Matters
@barecode @gcharters#Devoxx #Boost
Consider Cloud Costs
•In The Cloud …
• Small Footprint = Less $$$
• Faster Start-up = Less $$$
• More Throughput = Less $$$
@barecode @gcharters#Devoxx #Boost
Introducing Eclipse OpenJ9
•Eclipse Foundation Project
•Alternative to the HotSpot JVM
•Designed to run on mobile phones
• Focus on fast startup, low memory use & high performance
https://adoptopenjdk.net/
@barecode @gcharters#Devoxx #Boost
Use OpenJ9
FROM adoptopenjdk/openjdk8-openj9
VOLUME /tmp
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"]
Dockerfile – Classpath w/ OpenJ9
Dockerfile – JAR w/ OpenJ9
FROM adoptopenjdk/openjdk8-openj9
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
$ mvn boost:docker-build
@barecode @gcharters#Devoxx #Boost
🔥 Live Demo 🔥
Comparing Spring Boot w/
HotSpot & Eclipse OpenJ9
https://github.com/barecode/spring-petclinic
branch: docker-classpath-openj9
https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md
@barecode @gcharters#Devoxx #Boost
OpenJ9 – Awesome for Containers
Footprint is 60% smaller with OpenJ9
Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart
Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart
https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md
@barecode @gcharters#Devoxx #Boost
OpenJ9 – Awesome for Containers
Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart
Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart
Startup time is 30% faster with
OpenJ9 –Xshareclasses -Xquickstart
https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md
@barecode @gcharters#Devoxx #Boost
OpenJ9 – Awesome for Containers
Achieve peak throughput 70% faster
0 200 400 600 800 1000 1200 1400 1600
Throughput(transactions/sec)
Time (sec)
OpenJDK9 with HotSpot
OpenJDK9 with OpenJ9
OpenJDK9 with OpenJ9 w/AOT -Xtune:virtualized
-Xtune:virtualized and AOT good for CPU constrained situations and short running applications
https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md
@barecode @gcharters#Devoxx #Boost
Things Not Covered
• HotSpot vs OpenJ9 vs GraalVM vs Graal Native
• Always do your own testing!
• APIs / processes / app design (e.g. 12 factor)
• Documented Dockerfile Best Practices
• Non-root User (`USER`), multi-stage builds, etc
• Advanced stuff (see Tweaks in Spring Boot in a Container)
@barecode @gcharters#Devoxx #Boost
Summary
• Layer your Spring Boot app in Docker
• Maximize caching & re-use
• Minimize re-build churn
•Boost-maven-plugin can help with this
• Understand the contents & characteristics of your FROM
• Eclipse OpenJ9 gives an easy memory & performance win
@barecode @gcharters#Devoxx #Boost
Thank You!
Please rate the session.

More Related Content

What's hot

Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...
Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...
Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...Shift Conference
 
Deployment Patterns in the Ruby on Rails World
Deployment Patterns in the Ruby on Rails WorldDeployment Patterns in the Ruby on Rails World
Deployment Patterns in the Ruby on Rails WorldNikhil Mungel
 
The Bash Dashboard (Or: How to Use Bash for Data Analysis)
The Bash Dashboard (Or: How to Use Bash for Data Analysis)The Bash Dashboard (Or: How to Use Bash for Data Analysis)
The Bash Dashboard (Or: How to Use Bash for Data Analysis)Bram Adams
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and PracticeBo-Yi Wu
 
Distributing UI Libraries: in a post Web-Component world
Distributing UI Libraries: in a post Web-Component worldDistributing UI Libraries: in a post Web-Component world
Distributing UI Libraries: in a post Web-Component worldRachael L Moore
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Dockerfiles building docker images automatically v (workdir, env, add, and ...
Dockerfiles   building docker images automatically v (workdir, env, add, and ...Dockerfiles   building docker images automatically v (workdir, env, add, and ...
Dockerfiles building docker images automatically v (workdir, env, add, and ...ansonjonel
 
Rapid Prototyping Chatter with a PHP/Hack Canvas App on Heroku
Rapid Prototyping Chatter with a PHP/Hack Canvas App on HerokuRapid Prototyping Chatter with a PHP/Hack Canvas App on Heroku
Rapid Prototyping Chatter with a PHP/Hack Canvas App on HerokuSalesforce Developers
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabSoftware Guru
 
FullStack London - Cloud Native Node.js
FullStack London - Cloud Native Node.jsFullStack London - Cloud Native Node.js
FullStack London - Cloud Native Node.jsBethany Nicolle Griggs
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainGit Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainLemi Orhan Ergin
 
Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl
Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in PerlNagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl
Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in PerlNagios
 
Cooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugCooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugDavid Golden
 
Java to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.ioJava to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.ioMauricio (Salaboy) Salatino
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with DjangoRoger Barnes
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionFabio Kung
 
London Node.js User Group - Cloud-native Node.js
London Node.js User Group - Cloud-native Node.jsLondon Node.js User Group - Cloud-native Node.js
London Node.js User Group - Cloud-native Node.jsBethany Nicolle Griggs
 

What's hot (20)

Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...
Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...
Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...
 
How to Make Android Native Application
How to Make Android Native ApplicationHow to Make Android Native Application
How to Make Android Native Application
 
Deployment Patterns in the Ruby on Rails World
Deployment Patterns in the Ruby on Rails WorldDeployment Patterns in the Ruby on Rails World
Deployment Patterns in the Ruby on Rails World
 
The Bash Dashboard (Or: How to Use Bash for Data Analysis)
The Bash Dashboard (Or: How to Use Bash for Data Analysis)The Bash Dashboard (Or: How to Use Bash for Data Analysis)
The Bash Dashboard (Or: How to Use Bash for Data Analysis)
 
How to Add Original Library to Android NDK
How to Add Original Library to Android NDKHow to Add Original Library to Android NDK
How to Add Original Library to Android NDK
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and Practice
 
Distributing UI Libraries: in a post Web-Component world
Distributing UI Libraries: in a post Web-Component worldDistributing UI Libraries: in a post Web-Component world
Distributing UI Libraries: in a post Web-Component world
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Dockerfiles building docker images automatically v (workdir, env, add, and ...
Dockerfiles   building docker images automatically v (workdir, env, add, and ...Dockerfiles   building docker images automatically v (workdir, env, add, and ...
Dockerfiles building docker images automatically v (workdir, env, add, and ...
 
Rapid Prototyping Chatter with a PHP/Hack Canvas App on Heroku
Rapid Prototyping Chatter with a PHP/Hack Canvas App on HerokuRapid Prototyping Chatter with a PHP/Hack Canvas App on Heroku
Rapid Prototyping Chatter with a PHP/Hack Canvas App on Heroku
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
 
F3X12 FLOW3 Project Lifecycle
F3X12 FLOW3 Project LifecycleF3X12 FLOW3 Project Lifecycle
F3X12 FLOW3 Project Lifecycle
 
FullStack London - Cloud Native Node.js
FullStack London - Cloud Native Node.jsFullStack London - Cloud Native Node.js
FullStack London - Cloud Native Node.js
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainGit Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it Again
 
Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl
Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in PerlNagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl
Nagios Conference 2012 - Nathan Vonnahme - Writing Custom Nagios Plugins in Perl
 
Cooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with JitterbugCooking Perl with Chef: Real World Tutorial with Jitterbug
Cooking Perl with Chef: Real World Tutorial with Jitterbug
 
Java to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.ioJava to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.io
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with Django
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to Production
 
London Node.js User Group - Cloud-native Node.js
London Node.js User Group - Cloud-native Node.jsLondon Node.js User Group - Cloud-native Node.js
London Node.js User Group - Cloud-native Node.js
 

Similar to Optimizing Spring Boot apps for Docker

DockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best PracticesDockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best PracticesTibor Vass
 
DCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDocker, Inc.
 
Docker Demo @ IuK Seminar
Docker Demo @ IuK SeminarDocker Demo @ IuK Seminar
Docker Demo @ IuK SeminarMartin Scharm
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Ortus Solutions, Corp
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerOrtus Solutions, Corp
 
DCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDocker, Inc.
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Minimum Viable Docker: our journey towards orchestration
Minimum Viable Docker: our journey towards orchestrationMinimum Viable Docker: our journey towards orchestration
Minimum Viable Docker: our journey towards orchestrationOutlyer
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with dockerGiacomo Bagnoli
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby DevelopersAptible
 
Very Early Review - Rocket(CoreOS)
Very Early Review - Rocket(CoreOS)Very Early Review - Rocket(CoreOS)
Very Early Review - Rocket(CoreOS)충섭 김
 
JFrog container registry - DevOps extravaganza
JFrog container registry - DevOps extravaganza JFrog container registry - DevOps extravaganza
JFrog container registry - DevOps extravaganza Batel Zohar Tova
 
Using Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutionsUsing Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutionsSander van der Burg
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data scienceCalvin Giles
 
Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Hyun-Mook Choi
 
Happy porting x86 application to android
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to androidOwen Hsu
 
2018 the conf put git to work - increase the quality of your rails project...
2018 the conf   put git to work -  increase the quality of your rails project...2018 the conf   put git to work -  increase the quality of your rails project...
2018 the conf put git to work - increase the quality of your rails project...Rodrigo Urubatan
 

Similar to Optimizing Spring Boot apps for Docker (20)

DockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best PracticesDockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best Practices
 
DCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best Practices
 
Docker Demo @ IuK Seminar
Docker Demo @ IuK SeminarDocker Demo @ IuK Seminar
Docker Demo @ IuK Seminar
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and docker
 
DCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best PracticesDCSF19 Dockerfile Best Practices
DCSF19 Dockerfile Best Practices
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Minimum Viable Docker: our journey towards orchestration
Minimum Viable Docker: our journey towards orchestrationMinimum Viable Docker: our journey towards orchestration
Minimum Viable Docker: our journey towards orchestration
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby Developers
 
Very Early Review - Rocket(CoreOS)
Very Early Review - Rocket(CoreOS)Very Early Review - Rocket(CoreOS)
Very Early Review - Rocket(CoreOS)
 
JFrog container registry - DevOps extravaganza
JFrog container registry - DevOps extravaganza JFrog container registry - DevOps extravaganza
JFrog container registry - DevOps extravaganza
 
Using Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutionsUsing Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutions
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data science
 
Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부Fargate 를 이용한 ECS with VPC 1부
Fargate 를 이용한 ECS with VPC 1부
 
Happy porting x86 application to android
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to android
 
Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work tool
 
2018 the conf put git to work - increase the quality of your rails project...
2018 the conf   put git to work -  increase the quality of your rails project...2018 the conf   put git to work -  increase the quality of your rails project...
2018 the conf put git to work - increase the quality of your rails project...
 

More from Graham Charters

Explore Jakarta EE and MicroProfile on Azure with Open Liberty & OpenShift
Explore Jakarta EE and MicroProfile on Azure with Open Liberty & OpenShiftExplore Jakarta EE and MicroProfile on Azure with Open Liberty & OpenShift
Explore Jakarta EE and MicroProfile on Azure with Open Liberty & OpenShiftGraham Charters
 
How to get along with HATEOAS without letting the bad guys steal your lunch?
How to get along with HATEOAS without letting the bad guys steal your lunch?How to get along with HATEOAS without letting the bad guys steal your lunch?
How to get along with HATEOAS without letting the bad guys steal your lunch?Graham Charters
 
Cutting through the fog of microservices: lightsabers optional
Cutting through the fog of microservices: lightsabers optionalCutting through the fog of microservices: lightsabers optional
Cutting through the fog of microservices: lightsabers optionalGraham Charters
 
Are you ready for cloud-native Java?
Are you ready for cloud-native Java?Are you ready for cloud-native Java?
Are you ready for cloud-native Java?Graham Charters
 
A first look at Open Liberty
A first look at Open LibertyA first look at Open Liberty
A first look at Open LibertyGraham Charters
 
Microservices and OSGi: Better together?
Microservices and OSGi: Better together?Microservices and OSGi: Better together?
Microservices and OSGi: Better together?Graham Charters
 
Get Rapid Right-sized and Recent with the Liberty Repository
Get Rapid Right-sized and Recent with the Liberty RepositoryGet Rapid Right-sized and Recent with the Liberty Repository
Get Rapid Right-sized and Recent with the Liberty RepositoryGraham Charters
 
Monoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is ModularityMonoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is ModularityGraham Charters
 
Towards a Modularity Maturity Model
Towards a Modularity Maturity ModelTowards a Modularity Maturity Model
Towards a Modularity Maturity ModelGraham Charters
 
Hints and Tips for Modularizing Existing Enterprise Applications (OSGi Commun...
Hints and Tips for Modularizing Existing Enterprise Applications (OSGi Commun...Hints and Tips for Modularizing Existing Enterprise Applications (OSGi Commun...
Hints and Tips for Modularizing Existing Enterprise Applications (OSGi Commun...Graham Charters
 

More from Graham Charters (10)

Explore Jakarta EE and MicroProfile on Azure with Open Liberty & OpenShift
Explore Jakarta EE and MicroProfile on Azure with Open Liberty & OpenShiftExplore Jakarta EE and MicroProfile on Azure with Open Liberty & OpenShift
Explore Jakarta EE and MicroProfile on Azure with Open Liberty & OpenShift
 
How to get along with HATEOAS without letting the bad guys steal your lunch?
How to get along with HATEOAS without letting the bad guys steal your lunch?How to get along with HATEOAS without letting the bad guys steal your lunch?
How to get along with HATEOAS without letting the bad guys steal your lunch?
 
Cutting through the fog of microservices: lightsabers optional
Cutting through the fog of microservices: lightsabers optionalCutting through the fog of microservices: lightsabers optional
Cutting through the fog of microservices: lightsabers optional
 
Are you ready for cloud-native Java?
Are you ready for cloud-native Java?Are you ready for cloud-native Java?
Are you ready for cloud-native Java?
 
A first look at Open Liberty
A first look at Open LibertyA first look at Open Liberty
A first look at Open Liberty
 
Microservices and OSGi: Better together?
Microservices and OSGi: Better together?Microservices and OSGi: Better together?
Microservices and OSGi: Better together?
 
Get Rapid Right-sized and Recent with the Liberty Repository
Get Rapid Right-sized and Recent with the Liberty RepositoryGet Rapid Right-sized and Recent with the Liberty Repository
Get Rapid Right-sized and Recent with the Liberty Repository
 
Monoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is ModularityMonoliths are so 2001 – What you need is Modularity
Monoliths are so 2001 – What you need is Modularity
 
Towards a Modularity Maturity Model
Towards a Modularity Maturity ModelTowards a Modularity Maturity Model
Towards a Modularity Maturity Model
 
Hints and Tips for Modularizing Existing Enterprise Applications (OSGi Commun...
Hints and Tips for Modularizing Existing Enterprise Applications (OSGi Commun...Hints and Tips for Modularizing Existing Enterprise Applications (OSGi Commun...
Hints and Tips for Modularizing Existing Enterprise Applications (OSGi Commun...
 

Recently uploaded

Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfmbmh111980
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersEmilyJiang23
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...rajkumar669520
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationWave PLM
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAlluxio, Inc.
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionWave PLM
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfsteffenkarlsson2
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignNeo4j
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems ApproachNeo4j
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdfkalichargn70th171
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionMohammed Fazuluddin
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024vaibhav130304
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfFurqanuddin10
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfVictor Lopez
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Andrea Goulet
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfkalichargn70th171
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Soroosh Khodami
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfDeskTrack
 

Recently uploaded (20)

Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
AI Hackathon.pptx
AI                        Hackathon.pptxAI                        Hackathon.pptx
AI Hackathon.pptx
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
AI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in MichelangeloAI/ML Infra Meetup | ML explainability in Michelangelo
AI/ML Infra Meetup | ML explainability in Michelangelo
 
The Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion ProductionThe Impact of PLM Software on Fashion Production
The Impact of PLM Software on Fashion Production
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and PreventionSQL Injection Introduction and Prevention
SQL Injection Introduction and Prevention
 
IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024IT Software Development Resume, Vaibhav jha 2024
IT Software Development Resume, Vaibhav jha 2024
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 
5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand5 Reasons Driving Warehouse Management Systems Demand
5 Reasons Driving Warehouse Management Systems Demand
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdf
 

Optimizing Spring Boot apps for Docker

  • 1. @barecode @gcharters#Devoxx #Boost Optimizing Spring Boot apps for Docker Michael Thompson Senior Software Engineer, IBM @barecode Graham Charters STSM, IBM @gcharters
  • 2. Community Party @ Devoxx.be 2018 Continue the conversation Join us on Wednesday November 14 at 19:00! Register here: http://ibm.biz/IBMDEVOXXBELGIUM Kelly's Irish Pub De Keyserlei 27 B-2018 Antwerp
  • 3. @barecode @gcharters#Devoxx #Boost Spring Boot Dockerfile FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] Dockerfile https://spring.io/guides/gs/spring-boot-docker/
  • 4. @barecode @gcharters#Devoxx #Boost Spring Boot Dockerfile FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] It works … So what’s wrong with it? ¯_(ツ)_/¯ Dockerfile https://spring.io/guides/gs/spring-boot-docker/
  • 6. @barecode @gcharters#Devoxx #Boost Docker 101 (only the relevant bits)
  • 7. @barecode @gcharters#Devoxx #Boost Dockerfile & build Dockerfile FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] https://spring.io/guides/gs/spring-boot-docker/ docker build -t spring-petclinic:devoxx --build-arg JAR_FILE=target/spring-petclinic.jar .
  • 8. @barecode @gcharters#Devoxx #Boost Image dependency Dockerfile FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] https://spring.io/guides/gs/spring-boot-docker/ docker build -t spring-petclinic:devoxx --build-arg JAR_FILE=target/spring-petclinic.jar .
  • 9. @barecode @gcharters#Devoxx #Boost Image layers FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] Dockerfile https://spring.io/guides/gs/spring-boot-docker/ docker build -t spring-petclinic:devoxx --build-arg JAR_FILE=target/spring-petclinic.jar .
  • 10. @barecode @gcharters#Devoxx #Boost Image name Dockerfile FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] https://spring.io/guides/gs/spring-boot-docker/ docker build -t spring-petclinic:devoxx --build-arg JAR_FILE=target/spring-petclinic.jar .
  • 11. @barecode @gcharters#Devoxx #Boost Docker layer considerations •What you FROM has a huge influence on your image •Layers are cached •Any change to a layer rebuilds all layers that depend on them •Deleting things from lower layers doesn’t make things smaller
  • 13. @barecode @gcharters#Devoxx #Boost Spring Boot Dockerfile FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] Dockerfile https://spring.io/guides/gs/spring-boot-docker/ It works … So what’s wrong with it? ¯_(ツ)_/¯
  • 15. @barecode @gcharters#Devoxx #Boost But Let’s Look At The Layers
  • 16. @barecode @gcharters#Devoxx #Boost Spring Boot Dockerfile - JAR FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] Dockerfile https://spring.io/guides/gs/spring-boot-docker/ docker build -t spring-petclinic:devoxx --build-arg JAR_FILE=target/spring-petclinic.jar .
  • 17. @barecode @gcharters#Devoxx #Boost 🔥 Live Code 🔥 Let’s Do a Build https://github.com/barecode/spring-petclinic branch: docker-jar https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md
  • 18. @barecode @gcharters#Devoxx #Boost Spring Boot Dockerfile - JAR FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] Dockerfile https://spring.io/guides/gs/spring-boot-docker/ $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE spring-petclinic latest e514264e73de 37 seconds ago 141MB
  • 19. @barecode @gcharters#Devoxx #Boost Spring Boot Dockerfile - JAR FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] Dockerfile $ docker history spring-petclinic IMAGE CREATED CREATED BY SIZE COMMENT e514264e73de 45 seconds ago /bin/sh -c #(nop) ENTRYPOINT ["java" "-Djav… 0B 74b8516987f9 46 seconds ago /bin/sh -c #(nop) COPY file:b13fc8e4506f482f… 38.7MB ad9202208add 3 minutes ago /bin/sh -c #(nop) ARG JAR_FILE 0B 27aef1178da6 3 weeks ago /bin/sh -c #(nop) VOLUME [/tmp] 0B 54ae553cb104 7 weeks ago /bin/sh -c set -x && apk add --no-cache o… 98.2MB <missing> 7 weeks ago /bin/sh -c #(nop) ENV JAVA_ALPINE_VERSION=8… 0B <missing> 7 weeks ago /bin/sh -c #(nop) ENV JAVA_VERSION=8u171 0B <missing> 7 weeks ago /bin/sh -c #(nop) ENV PATH=/usr/local/sbin:… 0B <missing> 7 weeks ago /bin/sh -c #(nop) ENV JAVA_HOME=/usr/lib/jv… 0B <missing> 7 weeks ago /bin/sh -c { echo '#!/bin/sh'; echo 'set… 87B <missing> 7 weeks ago /bin/sh -c #(nop) ENV LANG=C.UTF-8 0B <missing> 7 weeks ago /bin/sh -c #(nop) CMD ["/bin/sh"] 0B <missing> 7 weeks ago /bin/sh -c #(nop) ADD file:25c10b1d1b41d46a1… 4.41MB Your classes are in here!
  • 20. @barecode @gcharters#Devoxx #Boost You Don’t Have 38MB Of Classes
  • 21. @barecode @gcharters#Devoxx #Boost Spring Boot Dockerfile - Classpath FROM openjdk:8-jdk-alpine VOLUME /tmp ARG DEPENDENCY=target/dependency COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib COPY ${DEPENDENCY}/META-INF /app/META-INF COPY ${DEPENDENCY}/BOOT-INF/classes /app ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"] Dockerfile https://spring.io/guides/gs/spring-boot-docker/ docker build -t spring-petclinic:classpath .
  • 22. @barecode @gcharters#Devoxx #Boost 🔥 Live Code 🔥 Let’s Do Different a Build https://github.com/barecode/spring-petclinic branch: docker-classpath https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md
  • 23. @barecode @gcharters#Devoxx #Boost Spring Boot Dockerfile - Classpath Dockerfile https://spring.io/guides/gs/spring-boot-docker/ $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE spring-petclinic latest 735d2848b9b1 14 seconds ago 142MB FROM openjdk:8-jdk-alpine VOLUME /tmp ARG DEPENDENCY=target/dependency COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib COPY ${DEPENDENCY}/META-INF /app/META-INF COPY ${DEPENDENCY}/BOOT-INF/classes /app ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"]
  • 24. @barecode @gcharters#Devoxx #Boost Spring Boot Dockerfile - Classpath Dockerfile $ docker history spring-petclinic IMAGE CREATED CREATED BY SIZE COMMENT 735d2848b9b1 14 seconds ago /bin/sh -c #(nop) ENTRYPOINT ["java" "-cp" … 0B ef9fb7cfff1e 14 seconds ago /bin/sh -c #(nop) COPY dir:ee4babbd63b94fe3c… 988kB d4d764183900 14 seconds ago /bin/sh -c #(nop) COPY dir:fa853b6962840dbef… 8.35kB 0d4350ccc4f3 15 seconds ago /bin/sh -c #(nop) COPY dir:0ea2765e5f62ee97e… 38.3MB 6d9191a8b48d 2 minutes ago /bin/sh -c #(nop) ARG DEPENDENCY=target/ 0B 27aef1178da6 3 weeks ago /bin/sh -c #(nop) VOLUME [/tmp] 0B 54ae553cb104 7 weeks ago /bin/sh -c set -x && apk add --no-cache o… 98.2MB <missing> 7 weeks ago /bin/sh -c #(nop) ENV JAVA_ALPINE_VERSION=8… 0B ... <missing> 8 weeks ago /bin/sh -c #(nop) ADD file:25c10b1d1b41d46a1… 4.41MB FROM openjdk:8-jdk-alpine VOLUME /tmp ARG DEPENDENCY=target/dependency COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib COPY ${DEPENDENCY}/META-INF /app/META-INF COPY ${DEPENDENCY}/BOOT-INF/classes /app ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"]
  • 25. @barecode @gcharters#Devoxx #Boost FROM openjdk:8-jdk-alpine VOLUME /tmp ARG DEPENDENCY=target/dependency COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib COPY ${DEPENDENCY}/META-INF /app/META-INF COPY ${DEPENDENCY}/BOOT-INF/classes /app ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"] Spring Boot Dockerfile - Classpath Dockerfile These are your classes!$ docker history spring-petclinic IMAGE CREATED CREATED BY SIZE COMMENT 735d2848b9b1 14 seconds ago /bin/sh -c #(nop) ENTRYPOINT ["java" "-cp" … 0B ef9fb7cfff1e 14 seconds ago /bin/sh -c #(nop) COPY dir:ee4babbd63b94fe3c… 988kB d4d764183900 14 seconds ago /bin/sh -c #(nop) COPY dir:fa853b6962840dbef… 8.35kB 0d4350ccc4f3 15 seconds ago /bin/sh -c #(nop) COPY dir:0ea2765e5f62ee97e… 38.3MB 6d9191a8b48d 2 minutes ago /bin/sh -c #(nop) ARG DEPENDENCY=target/ 0B 27aef1178da6 3 weeks ago /bin/sh -c #(nop) VOLUME [/tmp] 0B 54ae553cb104 7 weeks ago /bin/sh -c set -x && apk add --no-cache o… 98.2MB <missing> 7 weeks ago /bin/sh -c #(nop) ENV JAVA_ALPINE_VERSION=8… 0B ... <missing> 8 weeks ago /bin/sh -c #(nop) ADD file:25c10b1d1b41d46a1… 4.41MB
  • 26. @barecode @gcharters#Devoxx #Boost FROM openjdk:8-jdk-alpine VOLUME /tmp ARG DEPENDENCY=target/dependency COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib COPY ${DEPENDENCY}/META-INF /app/META-INF COPY ${DEPENDENCY}/BOOT-INF/classes /app ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"] Your Classes Should Be a Leaf! Dockerfile These are your classes!$ docker history spring-petclinic IMAGE CREATED CREATED BY SIZE COMMENT 735d2848b9b1 14 seconds ago /bin/sh -c #(nop) ENTRYPOINT ["java" "-cp" … 0B ef9fb7cfff1e 14 seconds ago /bin/sh -c #(nop) COPY dir:ee4babbd63b94fe3c… 988kB d4d764183900 14 seconds ago /bin/sh -c #(nop) COPY dir:fa853b6962840dbef… 8.35kB 0d4350ccc4f3 15 seconds ago /bin/sh -c #(nop) COPY dir:0ea2765e5f62ee97e… 38.3MB 6d9191a8b48d 2 minutes ago /bin/sh -c #(nop) ARG DEPENDENCY=target/ 0B 27aef1178da6 3 weeks ago /bin/sh -c #(nop) VOLUME [/tmp] 0B 54ae553cb104 7 weeks ago /bin/sh -c set -x && apk add --no-cache o… 98.2MB <missing> 7 weeks ago /bin/sh -c #(nop) ENV JAVA_ALPINE_VERSION=8… 0B ... <missing> 8 weeks ago /bin/sh -c #(nop) ADD file:25c10b1d1b41d46a1… 4.41MB
  • 27. @barecode @gcharters#Devoxx #Boost Layers Matter • Faster builds (cache re-use) • Faster deployents (less bits to push) • Less wasted Docker repository space (reduced storage costs) Step 1/7 : FROM openjdk:8-jdk-alpine ---> bf2da8bc5a91 ... Step 4/7 : COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib ---> Using cache ---> 76b7fe6ee7f7 The right layers matter …
  • 28. @barecode @gcharters#Devoxx #Boost How Do I Get There? Let boost-maven-plugin help you <plugin> <groupId>io.openliberty.boost</groupId> <artifactId>boost-maven-plugin</artifactId> <version>0.1.2</version> <configuration> <dockerizer>[jar|classpath]</dockerizer> </configuration> </plugin> pom.xml The right layers matter … $ mvn boost:docker-build
  • 29. @barecode @gcharters#Devoxx #Boost Review FROM openjdk:8-jdk-alpine VOLUME /tmp ARG DEPENDENCY=target/dependency COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib COPY ${DEPENDENCY}/META-INF /app/META-INF COPY ${DEPENDENCY}/BOOT-INF/classes /app ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"] Dockerfile - Classpath https://spring.io/guides/gs/spring-boot-docker/ Dockerfile - JAR FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] The right layers matter …
  • 30. @barecode @gcharters#Devoxx #Boost Review FROM openjdk:8-jdk-alpine VOLUME /tmp ARG DEPENDENCY=target/dependency COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib COPY ${DEPENDENCY}/META-INF /app/META-INF COPY ${DEPENDENCY}/BOOT-INF/classes /app ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"] Dockerfile - Classpath https://spring.io/guides/gs/spring-boot-docker/ Dockerfile - JAR FROM openjdk:8-jdk-alpine VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] Simple but inefficie nt for CI/CD A bit more complex, but optim al for iterative development The right layers matter …
  • 32. @barecode @gcharters#Devoxx #Boost Consider Cloud Costs •In The Cloud … • Small Footprint = Less $$$ • Faster Start-up = Less $$$ • More Throughput = Less $$$
  • 33. @barecode @gcharters#Devoxx #Boost Introducing Eclipse OpenJ9 •Eclipse Foundation Project •Alternative to the HotSpot JVM •Designed to run on mobile phones • Focus on fast startup, low memory use & high performance https://adoptopenjdk.net/
  • 34. @barecode @gcharters#Devoxx #Boost Use OpenJ9 FROM adoptopenjdk/openjdk8-openj9 VOLUME /tmp ARG DEPENDENCY=target/dependency COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib COPY ${DEPENDENCY}/META-INF /app/META-INF COPY ${DEPENDENCY}/BOOT-INF/classes /app ENTRYPOINT ["java","-cp","app:app/lib/*","org...PetClinicApplication"] Dockerfile – Classpath w/ OpenJ9 Dockerfile – JAR w/ OpenJ9 FROM adoptopenjdk/openjdk8-openj9 VOLUME /tmp ARG JAR_FILE COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] $ mvn boost:docker-build
  • 35. @barecode @gcharters#Devoxx #Boost 🔥 Live Demo 🔥 Comparing Spring Boot w/ HotSpot & Eclipse OpenJ9 https://github.com/barecode/spring-petclinic branch: docker-classpath-openj9 https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md
  • 36. @barecode @gcharters#Devoxx #Boost OpenJ9 – Awesome for Containers Footprint is 60% smaller with OpenJ9 Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md
  • 37. @barecode @gcharters#Devoxx #Boost OpenJ9 – Awesome for Containers Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart Hotspot OpenJ9 OpenJ9 -Xshareclasses -Xquickstart Startup time is 30% faster with OpenJ9 –Xshareclasses -Xquickstart https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md
  • 38. @barecode @gcharters#Devoxx #Boost OpenJ9 – Awesome for Containers Achieve peak throughput 70% faster 0 200 400 600 800 1000 1200 1400 1600 Throughput(transactions/sec) Time (sec) OpenJDK9 with HotSpot OpenJDK9 with OpenJ9 OpenJDK9 with OpenJ9 w/AOT -Xtune:virtualized -Xtune:virtualized and AOT good for CPU constrained situations and short running applications https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md
  • 39. @barecode @gcharters#Devoxx #Boost Things Not Covered • HotSpot vs OpenJ9 vs GraalVM vs Graal Native • Always do your own testing! • APIs / processes / app design (e.g. 12 factor) • Documented Dockerfile Best Practices • Non-root User (`USER`), multi-stage builds, etc • Advanced stuff (see Tweaks in Spring Boot in a Container)
  • 40. @barecode @gcharters#Devoxx #Boost Summary • Layer your Spring Boot app in Docker • Maximize caching & re-use • Minimize re-build churn •Boost-maven-plugin can help with this • Understand the contents & characteristics of your FROM • Eclipse OpenJ9 gives an easy memory & performance win
  • 41. @barecode @gcharters#Devoxx #Boost Thank You! Please rate the session.

Editor's Notes

  1. Abstract: Spring Boot is awesome. Docker is awesome. Together you can do great things. But, are you doing it the right way? We'll walk you through, in detail, the optimal way to structure Docker images for Spring Boot applications for iterative development. Structuring your Docker images correctly is really important for teams doing continuous integration and continuous delivery. Using Docker best practices, we'll show you the code and the technologies used to optimize Docker images for Spring Boot apps! Demo Instructions: https://github.com/barecode/spring-petclinic/blob/master/Demo-DevoxxBE2018.md Beginner & novice level Room 8 - Tuesday from 16:45 til 17:15