SlideShare a Scribd company logo
1 of 50
Continuous Delivery with Docker Containers and Java
The Good, the Bad, and the Ugly
Daniel Bryant
@danielbryantuk
Containers: Expectations versus reality
05/12/2018 @danielbryantuk
“DevOps”
@danielbryantuk
• Tech Consultant, Product Architect at Datawire,…
• Ex-academic, software developer, DBA, ops, CTO, conference tourist
• Java Champion, Continuous Delivery (CI/CD) advocate
• Leading change through technology and teams
05/12/2018 @danielbryantuk
bit.ly/2jWDSF7
oreil.ly/2RgU3Pe
Continuous Delivery & Docker
05/12/2018 @danielbryantuk
Velocity (with stability) is key to business success
“Continuous delivery is achieved when stability and
speed can satisfy business demand.
Discontinuous delivery occurs when stability and speed
are insufficient.”
- Steve Smith (@SteveSmithCD)
05/12/2018 @danielbryantuk
Velocity (with stability) is key to business success
“Continuous delivery is achieved when stability and
speed can satisfy business demand.
Discontinuous delivery occurs when stability and speed
are insufficient.”
- Steve Smith (@SteveSmithCD)
05/12/2018 @danielbryantuk
05/12/2018 @danielbryantuk
Feedback:
- Was our initial
hypothesis proven?
- How can we improve
business, architecture
and ops?
The good (with Docker and Java)
• Dev environment setup can Dockerized
• Docker enables repeatable builds
• Legacy tech (old frameworks etc) can be hermetically sealed
05/12/2018 @danielbryantuk
The bad (lessons learned for speed/stability)
“Why is the container image 1GB?
It’s a helloworld Java app!!!”
“Dinosaurs must have completed their
dev/test/deploy loop faster than me”
“This Java app runs slow (or freezes)
in Docker”
05/12/2018 @danielbryantuk
Impact of container tech on CD
05/12/2018 @danielbryantuk
05/12/2018 @danielbryantuk
05/12/2018 @danielbryantuk
Lessons learned
05/12/2018 @danielbryantuk
05/12/2018 @danielbryantuk
Make your dev environment like production
• Must build/test containers locally
• Perform (at least) happy path tests
• Use identical base images from production
• With same configuration
05/12/2018 @danielbryantuk
Lesson learned: Dockerfile content is super important
• OS choice (alpine or Distroless?)
• Configuration
• Build artifacts
• Exposing ports
• Oracle vs OpenJDK vs …?
• JDK vs JRE (vs jlinked binary?)
• Hotspot vs OpenJ9 vs SubstrateVM vs…?
• AOT vs JIT && CDS and ACDS
05/12/2018 @danielbryantuk
Please talk to the sysadmin people:
Their operational knowledge is invaluable
05/12/2018 @danielbryantuk
Start from good foundations: base image
05/12/2018 @danielbryantuk
https://github.com/danielbryantuk/oreilly-docker-java-
shopping
05/12/2018 @danielbryantuk
https://adoptopenjdk.net/
Start from good foundations: base image
05/12/2018 @danielbryantuk
https://github.com/danielbryantuk/oreilly-docker-java-
shopping
Getting smaller with Java 9, Java 11 LTS, Java 12
• Use jlink to create custom JRE
• Binary contains only:
• Your app modules
• Dependencies (JARs, modules)
• JRE modules needed
• Portola Project (JDK 12+)
05/12/2018 @danielbryantuk
But, why is my image so big?
05/12/2018 @danielbryantuk
05/12/2018 @danielbryantuk
05/12/2018 @danielbryantuk
Take a “dive” into a container
05/12/2018 @danielbryantuk
https://github.com/wagoodman/dive
05/12/2018 @danielbryantuk
05/12/2018 @danielbryantuk
Building in containers (multi-stage FTW)
05/12/2018 @danielbryantuk
BuildKit
05/12/2018 @danielbryantuk
The bad: different test and prod containers?
• Create “test” version of container
• Full OS (e.g. Ubuntu), JDK
• Test tools and data
• Create “prod” version of the container
• Minimal OS
• JRE only
• Easy to see app/configuration drift
05/12/2018 @danielbryantuk
The bad: different test and prod containers?
05/12/2018 @danielbryantuk
05/12/2018 @danielbryantuk
Lesson learned: Metadata is valuable
• Application metadata
• Version / GIT SHA
• Build metadata
• Build date
• Image name
• Vendor
• Quality metadata
• QA control, signed binaries, ephemeral support
• Security profiles (AppArmor), Security audited etc
05/12/2018 @danielbryantuk
Gareth and Amn totally stole my thunder… :)
05/12/2018 @danielbryantuk
Metadata - Adding Labels at build time
• Microscaling Systems’ Makefile
• Labelling automated builds on
DockerHub (h/t Ross Fairbanks)
• Create file ‘/hooks/build’
• label-schema.org
• microbadger.com
05/12/2018 @danielbryantuk
External registry with metadata support
05/12/2018 @danielbryantuk
05/12/2018 @danielbryantuk
Running tests with containers
05/12/2018 @danielbryantuk
Testing NFRs in the build pipeline
• Performance and Load testing
• Gatling / jmeter / Flood.io
• Security testing
• Findsecbugs / OWASP Dependency check
• Bdd-security (OWASP ZAP) / Arachni
• Gauntlt / Serverspec
• Docker Bench for Security / CoreOS Clair
05/12/2018 @danielbryantuk
Stability: Docker and Java
• Watch for JVM cgroup/taskset awareness (with JDK <= 8u131)
• getAvailableProcessors() may incorrectly report the number of cpus in Docker (JDK-8140793)
• Runtime.availableProcessors() ignores Linux taskset command (JDK-6515172)
• GC threads, default fork/join thread pool sizes (and others) is based from host CPU count
• Set container memory appropriately
• JVM requirements = Heap size (Xmx) + Metaspace + JVM overhead
• Account for native thread requirements e.g. thread stack size (Xss)
• Entropy
• Host entropy can soon be exhausted by crypto operations and /dev/random blocks
• -Djava.security.egd=file:/dev/./urandom (notes on this)
05/12/2018 @danielbryantuk 43
05/12/2018 @danielbryantuk
https://docs.google.com/presentation/d/11VjOwW8MjDqXX9uRx0BEGYrIQtGGcXJJWMxS2q-
02nA/edit#slide=id.g3c0528a66b_1_162
Running tests with containers
05/12/2018 @danielbryantuk
Security Visibility: Basic (Java) Code Scanning
05/12/2018 @danielbryantuk
Dependency Scanning
05/12/2018 @danielbryantuk
www.owasp.org/index.php/OWASP_Dependency_Check
Static Image Scanning
05/12/2018 @danielbryantuk
github.com/arminc/clair-scanner
Summary
05/12/2018 @danielbryantuk
In summary
• Docker and Java are a great combination
• But make sure you understand the technology and challenges
• Continuous delivery is essential with modern architecture/tech
• Container images must be the (single) source of truth within pipeline
• Provence (metadata) and validation (testing NFR) of builds is vital
• Not all developers are operationally aware
05/12/2018 @danielbryantuk
Thanks for listening…
Twitter: @danielbryantuk
Email: daniel.bryant@tai-dev.co.uk
Writing: https://www.infoq.com/profile/Daniel-Bryant
Talks: https://www.youtube.com/playlist?list=PLoVYf_0qOYNeBmrpjuBOOAqJnQb3QAEtM
05/12/2018 @danielbryantuk
bit.ly/2jWDSF7
oreil.ly/2RgU3Pe
Take A Breakout Survey
Access your session and/or workshop surveys for the conference at any time by tapping the Sessions
link on the navigation menu or block on the home screen.
Find the session/workshop you attended and tap on it to view the session details. On this page, you will
find a link to the survey.
Bedtime reading
05/12/2018 @danielbryantuk

More Related Content

What's hot

LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
Daniel Bryant
 

What's hot (20)

DevOpsCon 2017 "Continuous Delivery with Containers"
DevOpsCon 2017 "Continuous Delivery with Containers"DevOpsCon 2017 "Continuous Delivery with Containers"
DevOpsCon 2017 "Continuous Delivery with Containers"
 
Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"
Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"
Devoxx US 2017 "The Seven (More) Deadly Sins of Microservices"
 
muCon 2014 "Building Java Microservices for the Cloud"
muCon 2014 "Building Java Microservices for the Cloud"muCon 2014 "Building Java Microservices for the Cloud"
muCon 2014 "Building Java Microservices for the Cloud"
 
DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"
DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"
DevXDay KubeCon NA 2021: "From Kubernetes to PaaS to Developer Control Planes"
 
Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...
Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...
Container Days: Easy Debugging of Microservices Running on Kubernetes with Te...
 
High Performance Cloud-Native Microservices IndyCloudConf 2020
High Performance Cloud-Native Microservices IndyCloudConf 2020High Performance Cloud-Native Microservices IndyCloudConf 2020
High Performance Cloud-Native Microservices IndyCloudConf 2020
 
jSpring 2018 "Continuous Delivery Patterns for Modern Architectures and Java"
jSpring 2018 "Continuous Delivery Patterns for Modern Architectures and Java"jSpring 2018 "Continuous Delivery Patterns for Modern Architectures and Java"
jSpring 2018 "Continuous Delivery Patterns for Modern Architectures and Java"
 
LJCConf 2013 "Chuck Norris Doesn't Need DevOps"
LJCConf 2013 "Chuck Norris Doesn't Need DevOps"LJCConf 2013 "Chuck Norris Doesn't Need DevOps"
LJCConf 2013 "Chuck Norris Doesn't Need DevOps"
 
Accelerate your dev ops transformation with continuous automation
Accelerate your dev ops transformation with continuous automationAccelerate your dev ops transformation with continuous automation
Accelerate your dev ops transformation with continuous automation
 
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
LJC 4/21"Easy Debugging of Java Microservices Running on Kubernetes with Tele...
 
10 tips for Cloud Native Security
10 tips for Cloud Native Security10 tips for Cloud Native Security
10 tips for Cloud Native Security
 
stackconf 2021 | Platform as a Product
stackconf 2021 | Platform as a Productstackconf 2021 | Platform as a Product
stackconf 2021 | Platform as a Product
 
DevSecOps in a cloudnative world
DevSecOps in a cloudnative worldDevSecOps in a cloudnative world
DevSecOps in a cloudnative world
 
Ambassador Fest: "Kubernetes Workflow 101: The Big Picture of Idea to an API ...
Ambassador Fest: "Kubernetes Workflow 101: The Big Picture of Idea to an API ...Ambassador Fest: "Kubernetes Workflow 101: The Big Picture of Idea to an API ...
Ambassador Fest: "Kubernetes Workflow 101: The Big Picture of Idea to an API ...
 
Going Cloud Native - It Takes a Platform
Going Cloud Native - It Takes a PlatformGoing Cloud Native - It Takes a Platform
Going Cloud Native - It Takes a Platform
 
LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
LJC Mashup "Building Java Microservices for the Cloud && Chuck Norris Doesn't...
 
LJC: "Chuck Norris Doesn't Do DevOps...but Java developers might benefit"
LJC: "Chuck Norris Doesn't Do DevOps...but Java developers might benefit"LJC: "Chuck Norris Doesn't Do DevOps...but Java developers might benefit"
LJC: "Chuck Norris Doesn't Do DevOps...but Java developers might benefit"
 
Pulling Back the Curtain – CloudStack in Private and Community Clouds
Pulling Back the Curtain –CloudStack in Private and Community CloudsPulling Back the Curtain –CloudStack in Private and Community Clouds
Pulling Back the Curtain – CloudStack in Private and Community Clouds
 
ADDO 2020: "The past, present, and future of cloud native API gateways"
ADDO 2020: "The past, present, and future of cloud native API gateways"ADDO 2020: "The past, present, and future of cloud native API gateways"
ADDO 2020: "The past, present, and future of cloud native API gateways"
 
ContainerSched 2017 "Continuous Delivery with Containers: The Good, the Bad, ...
ContainerSched 2017 "Continuous Delivery with Containers: The Good, the Bad, ...ContainerSched 2017 "Continuous Delivery with Containers: The Good, the Bad, ...
ContainerSched 2017 "Continuous Delivery with Containers: The Good, the Bad, ...
 

Similar to DockerCon EU 2018 "Continuous Delivery with Docker and Java"

Plain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsPlain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticals
Angela Byron
 
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォームPivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Masayuki Matsushita
 

Similar to DockerCon EU 2018 "Continuous Delivery with Docker and Java" (20)

CodeOne 2019: "Continuous Delivery with Docker and Java"
CodeOne 2019: "Continuous Delivery with Docker and Java"CodeOne 2019: "Continuous Delivery with Docker and Java"
CodeOne 2019: "Continuous Delivery with Docker and Java"
 
Continuous Delivery with Containers: The Good, the Bad, and the Ugly - Daniel...
Continuous Delivery with Containers: The Good, the Bad, and the Ugly - Daniel...Continuous Delivery with Containers: The Good, the Bad, and the Ugly - Daniel...
Continuous Delivery with Containers: The Good, the Bad, and the Ugly - Daniel...
 
Continuous Delivery with Containers: The Good, the Bad, and the Ugly
Continuous Delivery with Containers: The Good, the Bad, and the UglyContinuous Delivery with Containers: The Good, the Bad, and the Ugly
Continuous Delivery with Containers: The Good, the Bad, and the Ugly
 
CodeOne SF 2018 "Continuous Delivery with Containers: Lessons Learned"
CodeOne SF 2018 "Continuous Delivery with Containers: Lessons Learned"CodeOne SF 2018 "Continuous Delivery with Containers: Lessons Learned"
CodeOne SF 2018 "Continuous Delivery with Containers: Lessons Learned"
 
Codemotion Rome 2018 "Continuous Delivery with Containers: The Good, the Bad ...
Codemotion Rome 2018 "Continuous Delivery with Containers: The Good, the Bad ...Codemotion Rome 2018 "Continuous Delivery with Containers: The Good, the Bad ...
Codemotion Rome 2018 "Continuous Delivery with Containers: The Good, the Bad ...
 
Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...
Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...
Ambassador Developer Office Hours: Summer of Kubernetes Ship Week 1: Intro to...
 
JAXDevOps 2017 "The Seven (More) Deadly Sins of Microservices
JAXDevOps 2017 "The Seven (More) Deadly Sins of MicroservicesJAXDevOps 2017 "The Seven (More) Deadly Sins of Microservices
JAXDevOps 2017 "The Seven (More) Deadly Sins of Microservices
 
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
 
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
O'Reilly/Nginx 2016: "Continuous Delivery with Containers: The Trials and Tri...
 
Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...
Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...
Devoxx 2017 "Continuous Delivery with Containers: The Good, the Bad, and the ...
 
vJUG 2017 "Continuous Delivery with Java and Docker: The Good, the Bad, and t...
vJUG 2017 "Continuous Delivery with Java and Docker: The Good, the Bad, and t...vJUG 2017 "Continuous Delivery with Java and Docker: The Good, the Bad, and t...
vJUG 2017 "Continuous Delivery with Java and Docker: The Good, the Bad, and t...
 
OReilly SACON 2016 "A Practical Guide for Continuous Delivery with Containers"
OReilly SACON 2016 "A Practical Guide for Continuous Delivery with Containers"OReilly SACON 2016 "A Practical Guide for Continuous Delivery with Containers"
OReilly SACON 2016 "A Practical Guide for Continuous Delivery with Containers"
 
DLJCJUG 2015: The Seven Deadly Sins of Microservices
DLJCJUG 2015: The Seven Deadly Sins of MicroservicesDLJCJUG 2015: The Seven Deadly Sins of Microservices
DLJCJUG 2015: The Seven Deadly Sins of Microservices
 
Optimizing Dell PowerEdge Configurations for Hadoop
Optimizing Dell PowerEdge Configurations for HadoopOptimizing Dell PowerEdge Configurations for Hadoop
Optimizing Dell PowerEdge Configurations for Hadoop
 
JavaOne 2016 "Java, Microservices, Cloud and Containers"
JavaOne 2016 "Java, Microservices, Cloud and Containers"JavaOne 2016 "Java, Microservices, Cloud and Containers"
JavaOne 2016 "Java, Microservices, Cloud and Containers"
 
Plain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticalsPlain english guide to drupal 8 criticals
Plain english guide to drupal 8 criticals
 
Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...
Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...
Application Quality Gates in Continuous Delivery: Deliver Better Software Fas...
 
Accelerating workloads and bursting data with Google Dataproc & Alluxio
Accelerating workloads and bursting data with Google Dataproc & AlluxioAccelerating workloads and bursting data with Google Dataproc & Alluxio
Accelerating workloads and bursting data with Google Dataproc & Alluxio
 
DrupalCon Austin: Planning for Performance
DrupalCon Austin: Planning for PerformanceDrupalCon Austin: Planning for Performance
DrupalCon Austin: Planning for Performance
 
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォームPivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
 

More from Daniel Bryant

More from Daniel Bryant (20)

ITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
ITKonekt 2023: The Busy Platform Engineers Guide to API GatewaysITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
ITKonekt 2023: The Busy Platform Engineers Guide to API Gateways
 
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...
CraftConf 2023 "Microservice Testing Techniques: Mocks vs Service Virtualizat...
 
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
 
Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...
Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...
Java Meetup 23: 'Debugging Microservices "Remocally" in Kubernetes with Telep...
 
DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"
DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"
DevRelCon 2022: "Is Product Led Growth (PLG) the “DevOps” of the DevRel World"
 
Fall 22: "From Kubernetes to PaaS to... err, what's next"
Fall 22: "From Kubernetes to PaaS to... err, what's next"Fall 22: "From Kubernetes to PaaS to... err, what's next"
Fall 22: "From Kubernetes to PaaS to... err, what's next"
 
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
Building Microservice Systems Without Cooking Your Laptop: Going “Remocal” wi...
 
KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...
KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...
KubeCrash 22: Debugging Microservices "Remocally" in Kubernetes with Telepres...
 
JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...
JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...
JAX London 22: Debugging Microservices "Remocally" in Kubernetes with Telepre...
 
CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"
CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"
CloudBuilders 2022: "The Past, Present, and Future of Cloud Native API Gateways"
 
KubeCon EU 2022: From Kubernetes to PaaS to Err What's Next
KubeCon EU 2022: From Kubernetes to PaaS to Err What's NextKubeCon EU 2022: From Kubernetes to PaaS to Err What's Next
KubeCon EU 2022: From Kubernetes to PaaS to Err What's Next
 
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
Devoxx UK 22: Debugging Java Microservices "Remocally" in Kubernetes with Tel...
 
Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...
Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...
Canadian CNCF: "Emissary-ingress 101: An introduction to the CNCF incubation-...
 
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
 
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
GOTOpia 2/2021 "Cloud Native Development Without the Toil: An Overview of Pra...
 
HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...
HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...
HashiCorp Webinar: "Getting started with Ambassador and Consul on Kubernetes ...
 
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"
 
SoftwareCircus 2020 "The Past, Present, and Future of Cloud Native API Gateways"
SoftwareCircus 2020 "The Past, Present, and Future of Cloud Native API Gateways"SoftwareCircus 2020 "The Past, Present, and Future of Cloud Native API Gateways"
SoftwareCircus 2020 "The Past, Present, and Future of Cloud Native API Gateways"
 
DevOpsCon 2020: The Past, Present, and Future of Cloud Native API Gateways
DevOpsCon 2020: The Past, Present, and Future of Cloud Native API GatewaysDevOpsCon 2020: The Past, Present, and Future of Cloud Native API Gateways
DevOpsCon 2020: The Past, Present, and Future of Cloud Native API Gateways
 
AllTheTalks 2020: "The Past, Present, and Future of Cloud Native API Gateways"
AllTheTalks 2020: "The Past, Present, and Future of Cloud Native API Gateways"AllTheTalks 2020: "The Past, Present, and Future of Cloud Native API Gateways"
AllTheTalks 2020: "The Past, Present, and Future of Cloud Native API Gateways"
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

DockerCon EU 2018 "Continuous Delivery with Docker and Java"

  • 1. Continuous Delivery with Docker Containers and Java The Good, the Bad, and the Ugly Daniel Bryant @danielbryantuk
  • 2. Containers: Expectations versus reality 05/12/2018 @danielbryantuk “DevOps”
  • 3. @danielbryantuk • Tech Consultant, Product Architect at Datawire,… • Ex-academic, software developer, DBA, ops, CTO, conference tourist • Java Champion, Continuous Delivery (CI/CD) advocate • Leading change through technology and teams 05/12/2018 @danielbryantuk bit.ly/2jWDSF7 oreil.ly/2RgU3Pe
  • 4. Continuous Delivery & Docker 05/12/2018 @danielbryantuk
  • 5. Velocity (with stability) is key to business success “Continuous delivery is achieved when stability and speed can satisfy business demand. Discontinuous delivery occurs when stability and speed are insufficient.” - Steve Smith (@SteveSmithCD) 05/12/2018 @danielbryantuk
  • 6. Velocity (with stability) is key to business success “Continuous delivery is achieved when stability and speed can satisfy business demand. Discontinuous delivery occurs when stability and speed are insufficient.” - Steve Smith (@SteveSmithCD) 05/12/2018 @danielbryantuk
  • 7. 05/12/2018 @danielbryantuk Feedback: - Was our initial hypothesis proven? - How can we improve business, architecture and ops?
  • 8. The good (with Docker and Java) • Dev environment setup can Dockerized • Docker enables repeatable builds • Legacy tech (old frameworks etc) can be hermetically sealed 05/12/2018 @danielbryantuk
  • 9. The bad (lessons learned for speed/stability) “Why is the container image 1GB? It’s a helloworld Java app!!!” “Dinosaurs must have completed their dev/test/deploy loop faster than me” “This Java app runs slow (or freezes) in Docker” 05/12/2018 @danielbryantuk
  • 10. Impact of container tech on CD 05/12/2018 @danielbryantuk
  • 15. Make your dev environment like production • Must build/test containers locally • Perform (at least) happy path tests • Use identical base images from production • With same configuration 05/12/2018 @danielbryantuk
  • 16. Lesson learned: Dockerfile content is super important • OS choice (alpine or Distroless?) • Configuration • Build artifacts • Exposing ports • Oracle vs OpenJDK vs …? • JDK vs JRE (vs jlinked binary?) • Hotspot vs OpenJ9 vs SubstrateVM vs…? • AOT vs JIT && CDS and ACDS 05/12/2018 @danielbryantuk
  • 17. Please talk to the sysadmin people: Their operational knowledge is invaluable 05/12/2018 @danielbryantuk
  • 18. Start from good foundations: base image 05/12/2018 @danielbryantuk https://github.com/danielbryantuk/oreilly-docker-java- shopping
  • 20. Start from good foundations: base image 05/12/2018 @danielbryantuk https://github.com/danielbryantuk/oreilly-docker-java- shopping
  • 21. Getting smaller with Java 9, Java 11 LTS, Java 12 • Use jlink to create custom JRE • Binary contains only: • Your app modules • Dependencies (JARs, modules) • JRE modules needed • Portola Project (JDK 12+) 05/12/2018 @danielbryantuk
  • 22. But, why is my image so big? 05/12/2018 @danielbryantuk
  • 25. Take a “dive” into a container 05/12/2018 @danielbryantuk https://github.com/wagoodman/dive
  • 28. Building in containers (multi-stage FTW) 05/12/2018 @danielbryantuk
  • 30. The bad: different test and prod containers? • Create “test” version of container • Full OS (e.g. Ubuntu), JDK • Test tools and data • Create “prod” version of the container • Minimal OS • JRE only • Easy to see app/configuration drift 05/12/2018 @danielbryantuk
  • 31. The bad: different test and prod containers? 05/12/2018 @danielbryantuk
  • 33. Lesson learned: Metadata is valuable • Application metadata • Version / GIT SHA • Build metadata • Build date • Image name • Vendor • Quality metadata • QA control, signed binaries, ephemeral support • Security profiles (AppArmor), Security audited etc 05/12/2018 @danielbryantuk
  • 34. Gareth and Amn totally stole my thunder… :) 05/12/2018 @danielbryantuk
  • 35. Metadata - Adding Labels at build time • Microscaling Systems’ Makefile • Labelling automated builds on DockerHub (h/t Ross Fairbanks) • Create file ‘/hooks/build’ • label-schema.org • microbadger.com 05/12/2018 @danielbryantuk
  • 36. External registry with metadata support 05/12/2018 @danielbryantuk
  • 38. Running tests with containers 05/12/2018 @danielbryantuk
  • 39. Testing NFRs in the build pipeline • Performance and Load testing • Gatling / jmeter / Flood.io • Security testing • Findsecbugs / OWASP Dependency check • Bdd-security (OWASP ZAP) / Arachni • Gauntlt / Serverspec • Docker Bench for Security / CoreOS Clair 05/12/2018 @danielbryantuk
  • 40. Stability: Docker and Java • Watch for JVM cgroup/taskset awareness (with JDK <= 8u131) • getAvailableProcessors() may incorrectly report the number of cpus in Docker (JDK-8140793) • Runtime.availableProcessors() ignores Linux taskset command (JDK-6515172) • GC threads, default fork/join thread pool sizes (and others) is based from host CPU count • Set container memory appropriately • JVM requirements = Heap size (Xmx) + Metaspace + JVM overhead • Account for native thread requirements e.g. thread stack size (Xss) • Entropy • Host entropy can soon be exhausted by crypto operations and /dev/random blocks • -Djava.security.egd=file:/dev/./urandom (notes on this) 05/12/2018 @danielbryantuk 43
  • 42. Running tests with containers 05/12/2018 @danielbryantuk
  • 43. Security Visibility: Basic (Java) Code Scanning 05/12/2018 @danielbryantuk
  • 45. Static Image Scanning 05/12/2018 @danielbryantuk github.com/arminc/clair-scanner
  • 47. In summary • Docker and Java are a great combination • But make sure you understand the technology and challenges • Continuous delivery is essential with modern architecture/tech • Container images must be the (single) source of truth within pipeline • Provence (metadata) and validation (testing NFR) of builds is vital • Not all developers are operationally aware 05/12/2018 @danielbryantuk
  • 48. Thanks for listening… Twitter: @danielbryantuk Email: daniel.bryant@tai-dev.co.uk Writing: https://www.infoq.com/profile/Daniel-Bryant Talks: https://www.youtube.com/playlist?list=PLoVYf_0qOYNeBmrpjuBOOAqJnQb3QAEtM 05/12/2018 @danielbryantuk bit.ly/2jWDSF7 oreil.ly/2RgU3Pe
  • 49. Take A Breakout Survey Access your session and/or workshop surveys for the conference at any time by tapping the Sessions link on the navigation menu or block on the home screen. Find the session/workshop you attended and tap on it to view the session details. On this page, you will find a link to the survey.