SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
Copyright © 2019 Oracle and/or its affiliates.
JVMs in Containers
Best Practices
David Delabassée - @delabassee
DevRel
Java Platform Group - Oracle
November 2019
Copyright © 2019 Oracle and/or its affiliates.
@delabassee
The following is intended to outline our general product direction. It is intended for information purposes
only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code,
or functionality, and should not be relied upon in making purchasing decisions. The development,
release, timing, and pricing of any features or functionality described for Oracle’s products may change
and remains at the sole discretion of Oracle Corporation.
Statements in this presentation relating to Oracle’s future plans, expectations, beliefs, intentions and
prospects are “forward-looking statements” and are subject to material risks and uncertainties. A detailed
discussion of these factors and other risks that affect our business is contained in Oracle’s Securities and
Exchange Commission (SEC) filings, including our most recent reports on Form 10-K and Form 10-Q
under the heading “Risk Factors.” These filings are available on the SEC’s website or on Oracle’s website
at http://www.oracle.com/investor. All information in this presentation is current as of September 2019
and Oracle undertakes no duty to update any statement in light of new information or future events.
Safe Harbor
Copyright © 2019 Oracle and/or its affiliates.
Copyright © 2019 Oracle and/or its affiliates.
Containers
• Package Software into Standardized Units
- Development
- Shipment
- Deployment
• Runtimes
- Docker, CRI-O, LXC, rkt, runC, systemd-nspawn, OpenVZ, etc.
Copyright © 2019 Oracle and/or its affiliates.
Container
Copyright © 2019 Oracle and/or its affiliates.
Container vs. VM
Infrastructure
Infrastructure
Host OS
Host OS
Hypervisor
Container Daemon
Guest OS A
Bin/libs
App #1
Bin/libs
App #1
Bin/libs
App #2
Guest OS B
Bin/libs
App #2
Java
Copyright © 2019 Oracle and/or its affiliates.
Tools
docker-maven-plugin
Jib + jib-maven-plugin
Testcontainers
…
Copyright © 2019 Oracle and/or its affiliates.
JVM Container Tooling
FaaS
Fn Project
OpenFaaS
OpenWhisk
…
Frameworks
Helidon
Quarkus
Micronaut
…
• JVM should behave as a good (Container) citizen
• “Improved latency”
Copyright © 2019 Oracle and/or its affiliates.
JVM in Containers - Towards a Symbiosis
Hello Container
Demo
Copyright © 2019 Oracle and/or its affiliates.
Latency
Copyright © 2019 Oracle and/or its affiliates.
Copyright © 2019 Oracle and/or its affiliates.
Latency
Container Start-Up
• 3 “core” layers
- Java application and its dependencies
- Java Runtime
- Operating System
• ⇨ Reduce layers size
Copyright © 2019 Oracle and/or its affiliates.
Stack of Layers
• Dependencies
• Leverage Container cache layer mechanism
• Anything that is (relatively) static in its own layer
• Fat JAR
• CDS Shared Archive
Copyright © 2019 Oracle and/or its affiliates.
Stack of Layers
Copyright © 2019 Oracle and/or its affiliates.
Java Runtime Image
Modules jlink flags MB
JDK Whole JDK! 316 100%
Runtime image All (explicit) --add-modules $(java --list-modules) 178 56% 100%
Custom runtime image Required modules only --add-modules $(jdeps --print-module-deps …) 50 16% 28%
… --no-header-files --no-man-pages
--strip-java-debug-attributes 44 14% 25%
… --compress=1 37 12% 21%
… --compress=2 34 11% 19%
316 MB 178 MB 50 MB 34 MB
Serverless Java function (Fn) - openjdk:13
• musl
Lightweight, fast, simple, free, C standard library implementation
https://www.musl-libc.org
• Alpine
Security-oriented, lightweight Linux distro with 4MB base image
https://www.alpinelinux.org
• Project Portola
Run the JVM on musl
https://openjdk.java.net/projects/portola/
Copyright © 2019 Oracle and/or its affiliates.
Operating System
Copyright © 2019 Oracle and/or its affiliates.
Copyright © 2019 Oracle and/or its affiliates.
Java Runtime Image
Minecraft server
java.base, java.compiler, java.desktop, java.management, java.naming,
java.rmi, java.scripting, java.sql, jdk.sctp, jdk.unsupported, jdk.zipfs
openjdk:13 - 12 modules 88 MB
--strip-debug --strip-java-debug-attributes -14 MB
--compress=1 -18 MB
--compress=2 -31 MB
--no-header-file --no-man-pages 0 MB (*)
openjdk-11-jdk (debian:buster) - all modules 554 MB (!!)
12 modules 469 MB
--strip-native-debug-symbols (new)
Copyright © 2019 Oracle and/or its affiliates.
Latency
Application Start-Up
0
10
20
30
40
50
60
70
80
90
8 9 10 11 12 13
time(ms)
Hello World
Copyright © 2019 Oracle and/or its affiliates.
Startup Time
• Bootstrap regressions in JDK 9 fixed! Keep on fixing!
• +120 startup-related enhancements in JDK 10 through JDK 13!
• Reduce memory footprint between multiple JVMs by sharing
common class metadata
• Improve startup time
• How?
- Loads classes from JAR file into a private internal representation
- Dumps it to a shared archive
- When JVMs (re)starts, the archive is memory-mapped to allow sharing of
R/O JVM metadata for these classes among multiple JVMs
Copyright © 2019 Oracle and/or its affiliates.
Class Data Sharing
CDS
Demo
Copyright © 2019 Oracle and/or its affiliates.
Copyright © 2019 Oracle and/or its affiliates.
Application CDS
Copyright © 2019 Oracle and/or its affiliates.
Application CDS
jdk-08-u202-b08-hotspot
jruby -e 1
real 0m1.601s
user 0m4.434s
sys 0m0.234s
jruby --dev -e 1
real 0m1.216s
user 0m1.646s
sys 0m0.162s
jruby --disable-gems --dev -e 1
real 0m0.853s
user 0m1.030s
sys 0m0.113s
jdk-13.jdk
… -J-XX:SharedArchiveFile=jruby.jsa
real 0m1.491s
user 0m3.378s
sys 0m0.220s
… -J-XX:SharedArchiveFile=jruby.jsa
real 0m1.089s
user 0m1.644s
sys 0m0.133s
… -J-XX:SharedArchiveFile=jruby.jsa
real 0m0.717s
user 0m0.944s
sys 0m0.110s
• Java 5 - Limited to system classes and serial GC
• Java 9 - Application CDS and other GCs (commercial feature + JEP 250)
• Java 10 - Application CDS (JEP 310)
• Java 12 - Default CDS Archives (JEP 341)
• Java 13 - Dynamic CDS Archives (JEP 350)
- Dynamic archiving of classes at the end of application execution
-XX:ArchiveClassesAtExit=my-app-cds.jsa
Copyright © 2019 Oracle and/or its affiliates.
Class Data Sharing
• High Performance Universal Virtual Machine
• Polyglot
• …
• Native Image
- Reduced startup time
- Improved foot-print
- Reduced image size
Copyright © 2019 Oracle and/or its affiliates.
GraalVM
https://www.graalvm.org
• Java 8 (*)
• Not supported
- InvokeDynamic and Method Handles, Dynamic Class Un/Loading, Finalizers, Security
Manager
- JVMTI, JMX, other native VM interfaces
• Mostly supported
- Reflections, Dynamic Proxy, JNI, Unsafe Memory Access, Static Initializers, References
Copyright © 2019 Oracle and/or its affiliates.
GraalVM limitations
https://github.com/oracle/graal/blob/master/substratevm/LIMITATIONS.md
Copyright © 2019 Oracle and/or its affiliates.
Container
JVM should behave as a good citizen
JDK-8179498 attach should be relative to /proc/pid/root and namespace
aware as jcmd, jstack, ... fail to attach (10)
JDK-8146115 Improve Docker container detection & resource config usage (10)
JDK-8193710 jcmd –l & jps do not list Java processes running in containers (11)
JDK-8203357 Container Metrics (11)
JDK-8186248 More flexibility in selecting Heap % of available RAM (8u144)
JDK-8203359 JFR jdk.CPUInformation event reports incorrect information when
running in Docker container (open)
JDK-8199944 Add Container MBean to JMX (open)
…
Copyright © 2019 Oracle and/or its affiliates.
Container Awareness
• The JVM tunes itself based on the system it runs on
• Behavior-Based Tuning dynamically optimizes the sizes of the heap
to meet an expected behavior
- Maximum Pause-time (-XX:MaxGCPauseMillis)
- Or Application Throughput (-XX:GCTimeRatio)
• Sets defaults for the GC, heap size, and runtime compiler
Copyright © 2019 Oracle and/or its affiliates.
Ergonomics
https://docs.oracle.com/en/java/javase/13/gctuning/ergonomics.html
Ergonomics
Demo
Copyright © 2019 Oracle and/or its affiliates.
Copyright © 2019 Oracle and/or its affiliates.
Wrap-Up
• Reduced “latency”
- Container Startup
- Application Startup
• JVM behaves as a good (Container) citizen
Copyright © 2019 Oracle and/or its affiliates.
JVMs in Containers
• Use the latest Java version and never java:latest !!!
• Only rely on actively-supported versions!
• Use a JRE Java runtime image instead of a JDK
• Move startup costs to the build phase
• It’s “containers as usual”
- Docker-bench-security, Snyk, Clair, Anchore, etc.
- Small(er) is better
- Reduce the potential attack surface
- Multistage build, etc.
Copyright © 2019 Oracle and/or its affiliates.
JVMs in Containers
Copyright © 2019 Oracle and/or its affiliates.
Choose your base image wisely
Copyright © 2019 Oracle and/or its affiliates.
Choose your base image wisely
Copyright © 2019 Oracle and/or its affiliates.
Choose your base image wisely
and secure it!
Thank you!
Copyright © 2019 Oracle and/or its affiliates.
DevRel
Java Platform Group - Oracle
October 2019
David Delabassée - @delabassee

Contenu connexe

Tendances

Going Serverless Using the Spring Framework Ecosystem
Going Serverless Using the Spring Framework EcosystemGoing Serverless Using the Spring Framework Ecosystem
Going Serverless Using the Spring Framework EcosystemVMware Tanzu
 
Full Steam Ahead, R2DBC!
Full Steam Ahead, R2DBC!Full Steam Ahead, R2DBC!
Full Steam Ahead, R2DBC!VMware Tanzu
 
Comparing JSF, Spring MVC, Stripes, Struts 2, Tapestry and Wicket
Comparing JSF, Spring MVC, Stripes, Struts 2, Tapestry and WicketComparing JSF, Spring MVC, Stripes, Struts 2, Tapestry and Wicket
Comparing JSF, Spring MVC, Stripes, Struts 2, Tapestry and WicketMatt Raible
 
Curious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks ComparisonCurious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks ComparisonHamed Hatami
 
SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진VMware Tanzu Korea
 
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDIMigrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDIMario-Leander Reimer
 
jDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring SmackdownjDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring SmackdownMert Çalışkan
 
Micronaut: A new way to build microservices
Micronaut: A new way to build microservicesMicronaut: A new way to build microservices
Micronaut: A new way to build microservicesLuram Archanjo
 
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)Robert Scholte
 
Spring: Your Next Java Micro-Framework
Spring: Your Next Java Micro-FrameworkSpring: Your Next Java Micro-Framework
Spring: Your Next Java Micro-FrameworkVMware Tanzu
 
Introducing Spring Framework 5.3
Introducing Spring Framework 5.3Introducing Spring Framework 5.3
Introducing Spring Framework 5.3VMware Tanzu
 
Spring Cloud Function: Where We Were, Where We Are, and Where We’re Going
Spring Cloud Function: Where We Were, Where We Are, and Where We’re GoingSpring Cloud Function: Where We Were, Where We Are, and Where We’re Going
Spring Cloud Function: Where We Were, Where We Are, and Where We’re GoingVMware Tanzu
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 UpdateRyan Cuprak
 
What’s New in Spring Data MongoDB
What’s New in Spring Data MongoDBWhat’s New in Spring Data MongoDB
What’s New in Spring Data MongoDBVMware Tanzu
 
Take the highway: Quarkus reactive routes | DevNation Tech Talk
Take the highway: Quarkus reactive routes | DevNation Tech TalkTake the highway: Quarkus reactive routes | DevNation Tech Talk
Take the highway: Quarkus reactive routes | DevNation Tech TalkRed Hat Developers
 
Using Magnolia in a Microservices Architecture
Using Magnolia in a Microservices ArchitectureUsing Magnolia in a Microservices Architecture
Using Magnolia in a Microservices ArchitectureMagnolia
 

Tendances (20)

Going Serverless Using the Spring Framework Ecosystem
Going Serverless Using the Spring Framework EcosystemGoing Serverless Using the Spring Framework Ecosystem
Going Serverless Using the Spring Framework Ecosystem
 
Full Steam Ahead, R2DBC!
Full Steam Ahead, R2DBC!Full Steam Ahead, R2DBC!
Full Steam Ahead, R2DBC!
 
Project Fuji/OpenESB Aquarium Paris
Project Fuji/OpenESB Aquarium ParisProject Fuji/OpenESB Aquarium Paris
Project Fuji/OpenESB Aquarium Paris
 
Java 9 Modularity in Action
Java 9 Modularity in ActionJava 9 Modularity in Action
Java 9 Modularity in Action
 
Comparing JSF, Spring MVC, Stripes, Struts 2, Tapestry and Wicket
Comparing JSF, Spring MVC, Stripes, Struts 2, Tapestry and WicketComparing JSF, Spring MVC, Stripes, Struts 2, Tapestry and Wicket
Comparing JSF, Spring MVC, Stripes, Struts 2, Tapestry and Wicket
 
Curious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks ComparisonCurious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks Comparison
 
SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진
 
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDIMigrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
 
jDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring SmackdownjDays2015 - JavaEE vs. Spring Smackdown
jDays2015 - JavaEE vs. Spring Smackdown
 
Micronaut: A new way to build microservices
Micronaut: A new way to build microservicesMicronaut: A new way to build microservices
Micronaut: A new way to build microservices
 
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
Java 9 and the impact on Maven Projects (ApacheCon Europe 2016)
 
Spring: Your Next Java Micro-Framework
Spring: Your Next Java Micro-FrameworkSpring: Your Next Java Micro-Framework
Spring: Your Next Java Micro-Framework
 
Introducing Spring Framework 5.3
Introducing Spring Framework 5.3Introducing Spring Framework 5.3
Introducing Spring Framework 5.3
 
Spring Cloud Function: Where We Were, Where We Are, and Where We’re Going
Spring Cloud Function: Where We Were, Where We Are, and Where We’re GoingSpring Cloud Function: Where We Were, Where We Are, and Where We’re Going
Spring Cloud Function: Where We Were, Where We Are, and Where We’re Going
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 Update
 
What’s New in Spring Data MongoDB
What’s New in Spring Data MongoDBWhat’s New in Spring Data MongoDB
What’s New in Spring Data MongoDB
 
Karaf ee-apachecon eu-2012
Karaf ee-apachecon eu-2012Karaf ee-apachecon eu-2012
Karaf ee-apachecon eu-2012
 
Take the highway: Quarkus reactive routes | DevNation Tech Talk
Take the highway: Quarkus reactive routes | DevNation Tech TalkTake the highway: Quarkus reactive routes | DevNation Tech Talk
Take the highway: Quarkus reactive routes | DevNation Tech Talk
 
Java Technology Trends
Java Technology TrendsJava Technology Trends
Java Technology Trends
 
Using Magnolia in a Microservices Architecture
Using Magnolia in a Microservices ArchitectureUsing Magnolia in a Microservices Architecture
Using Magnolia in a Microservices Architecture
 

Similaire à JVMs in Containers

JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best PracticesDavid Delabassee
 
Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Shaun Smith
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsDavid Delabassee
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsDavid Delabassee
 
Java EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudJava EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudBruno Borges
 
Java in a world of containers
Java in a world of containersJava in a world of containers
Java in a world of containersDocker, Inc.
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Arun Gupta
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKWolfgang Weigend
 
SemeruRuntimesUnderTheCover .pptx
SemeruRuntimesUnderTheCover .pptxSemeruRuntimesUnderTheCover .pptx
SemeruRuntimesUnderTheCover .pptxSumanMitra22
 
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12cDeveloping Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12cBruno Borges
 
Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018CodeOps Technologies LLP
 
Java @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SPJava @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SPIlan Salviano
 
GlassFish in Production Environments
GlassFish in Production EnvironmentsGlassFish in Production Environments
GlassFish in Production EnvironmentsBruno Borges
 
Java 40 versions_sgp
Java 40 versions_sgpJava 40 versions_sgp
Java 40 versions_sgpmichaelisvy
 
Confoo 202 - MySQL Group Replication and ReplicaSet
Confoo 202 - MySQL Group Replication and ReplicaSetConfoo 202 - MySQL Group Replication and ReplicaSet
Confoo 202 - MySQL Group Replication and ReplicaSetDave Stokes
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with DockerMariaDB plc
 

Similaire à JVMs in Containers (20)

JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best Practices
 
Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019Serverless Java: JJUG CCC 2019
Serverless Java: JJUG CCC 2019
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and Triumphs
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & Triumphs
 
Java Cloud and Container Ready
Java Cloud and Container ReadyJava Cloud and Container Ready
Java Cloud and Container Ready
 
JDK 10 Java Module System
JDK 10 Java Module SystemJDK 10 Java Module System
JDK 10 Java Module System
 
Java EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudJava EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The Cloud
 
Java in a world of containers
Java in a world of containersJava in a world of containers
Java in a world of containers
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDK
 
SemeruRuntimesUnderTheCover .pptx
SemeruRuntimesUnderTheCover .pptxSemeruRuntimesUnderTheCover .pptx
SemeruRuntimesUnderTheCover .pptx
 
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12cDeveloping Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
Developing Java EE Applications on IntelliJ IDEA with Oracle WebLogic 12c
 
Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018Java is Container Ready - Vaibhav - Container Conference 2018
Java is Container Ready - Vaibhav - Container Conference 2018
 
Java @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SPJava @ Cloud - Setor Público SP
Java @ Cloud - Setor Público SP
 
GlassFish in Production Environments
GlassFish in Production EnvironmentsGlassFish in Production Environments
GlassFish in Production Environments
 
Splunking the JVM
Splunking the JVMSplunking the JVM
Splunking the JVM
 
Java 40 versions_sgp
Java 40 versions_sgpJava 40 versions_sgp
Java 40 versions_sgp
 
Ausoug glassfish perth
Ausoug glassfish perthAusoug glassfish perth
Ausoug glassfish perth
 
Confoo 202 - MySQL Group Replication and ReplicaSet
Confoo 202 - MySQL Group Replication and ReplicaSetConfoo 202 - MySQL Group Replication and ReplicaSet
Confoo 202 - MySQL Group Replication and ReplicaSet
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with Docker
 

Plus de David Delabassee

Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessDavid Delabassee
 
Java Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed BanffJava Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed BanffDavid Delabassee
 
Java EE 8 - February 2017 update
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 updateDavid Delabassee
 
Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016David Delabassee
 
Java EE 8 - Work in progress
Java EE 8 - Work in progressJava EE 8 - Work in progress
Java EE 8 - Work in progressDavid Delabassee
 
HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)David Delabassee
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyDavid Delabassee
 
Java EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web frontJava EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web frontDavid Delabassee
 
What's coming in Java EE 8
What's coming in Java EE 8What's coming in Java EE 8
What's coming in Java EE 8David Delabassee
 
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0David Delabassee
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot David Delabassee
 

Plus de David Delabassee (20)

Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - Serverless
 
Java Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed BanffJava Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed Banff
 
Serverless Kotlin
Serverless KotlinServerless Kotlin
Serverless Kotlin
 
REST in an Async World
REST in an Async WorldREST in an Async World
REST in an Async World
 
JAX-RS 2.1 Reloaded
JAX-RS 2.1 ReloadedJAX-RS 2.1 Reloaded
JAX-RS 2.1 Reloaded
 
Java EE 8 - February 2017 update
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 update
 
Java EE Next
Java EE NextJava EE Next
Java EE Next
 
Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016
 
HTTP/2 comes to Java
HTTP/2 comes to JavaHTTP/2 comes to Java
HTTP/2 comes to Java
 
Java EE 8 - Work in progress
Java EE 8 - Work in progressJava EE 8 - Work in progress
Java EE 8 - Work in progress
 
HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and Strategy
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
Java EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web frontJava EE 8 - What’s new on the Web front
Java EE 8 - What’s new on the Web front
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
What's coming in Java EE 8
What's coming in Java EE 8What's coming in Java EE 8
What's coming in Java EE 8
 
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
 
MVC 1.0 / JSR 371
MVC 1.0 / JSR 371MVC 1.0 / JSR 371
MVC 1.0 / JSR 371
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot
 
Avatar 2.0
Avatar 2.0Avatar 2.0
Avatar 2.0
 

Dernier

Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 

Dernier (20)

Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 

JVMs in Containers

  • 1. Copyright © 2019 Oracle and/or its affiliates. JVMs in Containers Best Practices David Delabassée - @delabassee DevRel Java Platform Group - Oracle November 2019
  • 2. Copyright © 2019 Oracle and/or its affiliates. @delabassee
  • 3. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. Statements in this presentation relating to Oracle’s future plans, expectations, beliefs, intentions and prospects are “forward-looking statements” and are subject to material risks and uncertainties. A detailed discussion of these factors and other risks that affect our business is contained in Oracle’s Securities and Exchange Commission (SEC) filings, including our most recent reports on Form 10-K and Form 10-Q under the heading “Risk Factors.” These filings are available on the SEC’s website or on Oracle’s website at http://www.oracle.com/investor. All information in this presentation is current as of September 2019 and Oracle undertakes no duty to update any statement in light of new information or future events. Safe Harbor Copyright © 2019 Oracle and/or its affiliates.
  • 4. Copyright © 2019 Oracle and/or its affiliates. Containers
  • 5. • Package Software into Standardized Units - Development - Shipment - Deployment • Runtimes - Docker, CRI-O, LXC, rkt, runC, systemd-nspawn, OpenVZ, etc. Copyright © 2019 Oracle and/or its affiliates. Container
  • 6. Copyright © 2019 Oracle and/or its affiliates. Container vs. VM Infrastructure Infrastructure Host OS Host OS Hypervisor Container Daemon Guest OS A Bin/libs App #1 Bin/libs App #1 Bin/libs App #2 Guest OS B Bin/libs App #2
  • 7. Java Copyright © 2019 Oracle and/or its affiliates.
  • 8. Tools docker-maven-plugin Jib + jib-maven-plugin Testcontainers … Copyright © 2019 Oracle and/or its affiliates. JVM Container Tooling FaaS Fn Project OpenFaaS OpenWhisk … Frameworks Helidon Quarkus Micronaut …
  • 9. • JVM should behave as a good (Container) citizen • “Improved latency” Copyright © 2019 Oracle and/or its affiliates. JVM in Containers - Towards a Symbiosis
  • 10. Hello Container Demo Copyright © 2019 Oracle and/or its affiliates.
  • 11. Latency Copyright © 2019 Oracle and/or its affiliates.
  • 12. Copyright © 2019 Oracle and/or its affiliates. Latency Container Start-Up
  • 13. • 3 “core” layers - Java application and its dependencies - Java Runtime - Operating System • ⇨ Reduce layers size Copyright © 2019 Oracle and/or its affiliates. Stack of Layers
  • 14. • Dependencies • Leverage Container cache layer mechanism • Anything that is (relatively) static in its own layer • Fat JAR • CDS Shared Archive Copyright © 2019 Oracle and/or its affiliates. Stack of Layers
  • 15. Copyright © 2019 Oracle and/or its affiliates. Java Runtime Image Modules jlink flags MB JDK Whole JDK! 316 100% Runtime image All (explicit) --add-modules $(java --list-modules) 178 56% 100% Custom runtime image Required modules only --add-modules $(jdeps --print-module-deps …) 50 16% 28% … --no-header-files --no-man-pages --strip-java-debug-attributes 44 14% 25% … --compress=1 37 12% 21% … --compress=2 34 11% 19% 316 MB 178 MB 50 MB 34 MB Serverless Java function (Fn) - openjdk:13
  • 16. • musl Lightweight, fast, simple, free, C standard library implementation https://www.musl-libc.org • Alpine Security-oriented, lightweight Linux distro with 4MB base image https://www.alpinelinux.org • Project Portola Run the JVM on musl https://openjdk.java.net/projects/portola/ Copyright © 2019 Oracle and/or its affiliates. Operating System
  • 17. Copyright © 2019 Oracle and/or its affiliates.
  • 18. Copyright © 2019 Oracle and/or its affiliates. Java Runtime Image Minecraft server java.base, java.compiler, java.desktop, java.management, java.naming, java.rmi, java.scripting, java.sql, jdk.sctp, jdk.unsupported, jdk.zipfs openjdk:13 - 12 modules 88 MB --strip-debug --strip-java-debug-attributes -14 MB --compress=1 -18 MB --compress=2 -31 MB --no-header-file --no-man-pages 0 MB (*) openjdk-11-jdk (debian:buster) - all modules 554 MB (!!) 12 modules 469 MB --strip-native-debug-symbols (new)
  • 19. Copyright © 2019 Oracle and/or its affiliates. Latency Application Start-Up
  • 20. 0 10 20 30 40 50 60 70 80 90 8 9 10 11 12 13 time(ms) Hello World Copyright © 2019 Oracle and/or its affiliates. Startup Time • Bootstrap regressions in JDK 9 fixed! Keep on fixing! • +120 startup-related enhancements in JDK 10 through JDK 13!
  • 21. • Reduce memory footprint between multiple JVMs by sharing common class metadata • Improve startup time • How? - Loads classes from JAR file into a private internal representation - Dumps it to a shared archive - When JVMs (re)starts, the archive is memory-mapped to allow sharing of R/O JVM metadata for these classes among multiple JVMs Copyright © 2019 Oracle and/or its affiliates. Class Data Sharing
  • 22. CDS Demo Copyright © 2019 Oracle and/or its affiliates.
  • 23. Copyright © 2019 Oracle and/or its affiliates. Application CDS
  • 24. Copyright © 2019 Oracle and/or its affiliates. Application CDS jdk-08-u202-b08-hotspot jruby -e 1 real 0m1.601s user 0m4.434s sys 0m0.234s jruby --dev -e 1 real 0m1.216s user 0m1.646s sys 0m0.162s jruby --disable-gems --dev -e 1 real 0m0.853s user 0m1.030s sys 0m0.113s jdk-13.jdk … -J-XX:SharedArchiveFile=jruby.jsa real 0m1.491s user 0m3.378s sys 0m0.220s … -J-XX:SharedArchiveFile=jruby.jsa real 0m1.089s user 0m1.644s sys 0m0.133s … -J-XX:SharedArchiveFile=jruby.jsa real 0m0.717s user 0m0.944s sys 0m0.110s
  • 25. • Java 5 - Limited to system classes and serial GC • Java 9 - Application CDS and other GCs (commercial feature + JEP 250) • Java 10 - Application CDS (JEP 310) • Java 12 - Default CDS Archives (JEP 341) • Java 13 - Dynamic CDS Archives (JEP 350) - Dynamic archiving of classes at the end of application execution -XX:ArchiveClassesAtExit=my-app-cds.jsa Copyright © 2019 Oracle and/or its affiliates. Class Data Sharing
  • 26. • High Performance Universal Virtual Machine • Polyglot • … • Native Image - Reduced startup time - Improved foot-print - Reduced image size Copyright © 2019 Oracle and/or its affiliates. GraalVM https://www.graalvm.org
  • 27. • Java 8 (*) • Not supported - InvokeDynamic and Method Handles, Dynamic Class Un/Loading, Finalizers, Security Manager - JVMTI, JMX, other native VM interfaces • Mostly supported - Reflections, Dynamic Proxy, JNI, Unsafe Memory Access, Static Initializers, References Copyright © 2019 Oracle and/or its affiliates. GraalVM limitations https://github.com/oracle/graal/blob/master/substratevm/LIMITATIONS.md
  • 28. Copyright © 2019 Oracle and/or its affiliates. Container JVM should behave as a good citizen
  • 29. JDK-8179498 attach should be relative to /proc/pid/root and namespace aware as jcmd, jstack, ... fail to attach (10) JDK-8146115 Improve Docker container detection & resource config usage (10) JDK-8193710 jcmd –l & jps do not list Java processes running in containers (11) JDK-8203357 Container Metrics (11) JDK-8186248 More flexibility in selecting Heap % of available RAM (8u144) JDK-8203359 JFR jdk.CPUInformation event reports incorrect information when running in Docker container (open) JDK-8199944 Add Container MBean to JMX (open) … Copyright © 2019 Oracle and/or its affiliates. Container Awareness
  • 30. • The JVM tunes itself based on the system it runs on • Behavior-Based Tuning dynamically optimizes the sizes of the heap to meet an expected behavior - Maximum Pause-time (-XX:MaxGCPauseMillis) - Or Application Throughput (-XX:GCTimeRatio) • Sets defaults for the GC, heap size, and runtime compiler Copyright © 2019 Oracle and/or its affiliates. Ergonomics https://docs.oracle.com/en/java/javase/13/gctuning/ergonomics.html
  • 31. Ergonomics Demo Copyright © 2019 Oracle and/or its affiliates.
  • 32. Copyright © 2019 Oracle and/or its affiliates. Wrap-Up
  • 33. • Reduced “latency” - Container Startup - Application Startup • JVM behaves as a good (Container) citizen Copyright © 2019 Oracle and/or its affiliates. JVMs in Containers
  • 34. • Use the latest Java version and never java:latest !!! • Only rely on actively-supported versions! • Use a JRE Java runtime image instead of a JDK • Move startup costs to the build phase • It’s “containers as usual” - Docker-bench-security, Snyk, Clair, Anchore, etc. - Small(er) is better - Reduce the potential attack surface - Multistage build, etc. Copyright © 2019 Oracle and/or its affiliates. JVMs in Containers
  • 35. Copyright © 2019 Oracle and/or its affiliates. Choose your base image wisely
  • 36. Copyright © 2019 Oracle and/or its affiliates. Choose your base image wisely
  • 37. Copyright © 2019 Oracle and/or its affiliates. Choose your base image wisely and secure it!
  • 38. Thank you! Copyright © 2019 Oracle and/or its affiliates. DevRel Java Platform Group - Oracle October 2019 David Delabassée - @delabassee