SlideShare a Scribd company logo
DOCKER AND JAVA
ANTHONY DAHANNE, MONTRÉAL JUG, JANUARY 28TH 2016
@anthonydahanne
Anthony Dahanne, Software Engineer @
Terracotta, a Software AG company
Working on the Terracotta Management Console,
and its integration in Terracotta products
And strong Docker supporter :-P , trying to
containerize as much as I can !
LET ME INTRODUCE MYSELF
We’re hiring Software Engineers ! Contact me !
AGENDA
• Docker fundamentals : quick recap
• Java applications in containers
• Hello world from a Java container
• SpringBoot app in a container (+ Maven + IntelliJ IDEA integrations)
• Java Web Applications (war) Docker pipelines
• Docker cloud based CI/CD
• CI/CD using on premises familiar tools (Jenkins, Nexus)
• Extras
• Jenkins container-based slaves
• Interacting with Docker from Java with Docker Java
VMS VS CONTAINERS
IT’S ALL ABOUT THE (LINUX?) KERNEL !
picture from http://www.enterprisetech.com/2014/08/18/ibm-techies-pit-docker-kvm-bare-metal/
DOCKER CONTAINERS / IMAGES : A PILE OF LAYERS
A DOCKER IMAGE IS A DIFF ON TOP OF ITS PARENT
picture from : https://docs.docker.com/v1.6/terms/layer/
Host OS
Docker daemon
Images Containers
Docker CLI
> docker run ubuntu bash
> docker ps
> docker images
> etc.
Docker Compose
> docker-compose build
> docker-compose up
> docker-compose kill
> etc. Volumes
Kinematic
REST API
tcp (tls) / Unix socket
Host OS
Docker daemon
Ima
ges
Conta
iners
Volum
es
DOCKER VOCABULARY VS JAVA VOCABULARY
• Repository : houses grouped artifacts
• Artifact : org.ehcache:ehcache:3.0.0.m4 (+type : jar/sources/etc.)
Group id VersionArtifact id
DOCKER VOCABULARY VS JAVA VOCABULARY
• Registry : hosts repositories
• Repositories : house collections of tagged images
• Image : localhost:5000/anthony/mycoolimage:v2
DockerHub / quay.io / Registry V2
Registry location Repository name Tag
Registry @ SoftwareAG
anthony/tmc
Registry
ubuntu anthonydahanne/terracotta
anthonydahanne/petclinic
latest 12.04 latest
4.3.1-
oss latest 5.0
Host OS
Docker CLI
Docker daemon
Images
Host OS
Docker daemon
Images
Docker CLI
REST API
tcp (tls) / Unix socket
DEMO TIME !
• Hello world from a Java container
• SpringBoot app in a container (+ Maven + IntelliJ IDEA integrations)
DOCKER CLOUD BASED CI/CD
PUSH THAT CODE AROUND !
EC2 Azure GCE
TutumGithub DockerHub
Commit & Push
Trigger Automated Build Trigger Redeploy / Scale
Create & Start Container
DEMO TIME !
• Petclinic cloud based CI/CD
• Petclinic built (war + image) by DockerHub
• Deployed by Tutum
ON PREMISES CI/CD
RE USING EXISTING INFRA !
Git Repo
Jenkins
Commit & Push
Trigger mvn job
Create & Start Container
Docker
daemons
Regular
Slaves
Registry
Image build Push image to registry
Docker
daemon
DEMO TIME !
• Petclinic built (war and then image) by Jenkins
• Pushed to Nexus 3 by Jenkins
• Deployed to a machine running Docker by Jenkins
EXTRAS
JENKINS DOCKER PLUGIN : ADD SLAVES CREATING CONTAINERS
EXTRAS
INTERACTING WITH DOCKER WITH DOCKER JAVA
DockerClient dockerClient = DockerClientBuilder.getInstance(dockerUrl).build();
Info info = dockerClient.infoCmd().exec();
List<Container> containers = dockerClient.listContainersCmd()
.withShowAll(false)
.exec();
CreateContainerResponse container = dockerClient.createContainerCmd("busybox")
.withCmd("touch", "/test")
.exec();
dockerClient.startContainerCmd(container.getId()).exec();
dockerClient.stopContainerCmd(container.getId()).exec();
<dependency>
<groupId>com.github.docker-java</groupId>
<artifactId>docker-java</artifactId>
<version>2.1.2</version>
</dependency>
Demo at : https://github.com/anthonydahanne/montrealjug_docker_java/tree/04_spring_boot_app_docker_api
LINKS OF INTERESTS
• Presentation links :
http://blog.dahanne.net/2016/01/31/docker-and-java-notes-from-the-montreal-jug-presentation/
https://github.com/anthonydahanne/montrealjug_docker_java
• Jenkins plugins
https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin
https://wiki.jenkins-ci.org/display/JENKINS/Support+Core+Plugin
https://wiki.jenkins-ci.org/display/JENKINS/Docker+build+step+plugin
https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Build+and+Publish+plugin
https://updates.jenkins-ci.org/download/plugins/
• DockerHub repositories
https://hub.docker.com/_/java/
https://hub.docker.com/_/jenkins/
https://hub.docker.com/_/tomcat/
https://hub.docker.com/_/maven/
https://hub.docker.com/r/anthonydahanne/terracotta-server-oss/
https://hub.docker.com/r/anthonydahanne/jenkins_with_plugins/
• Others
https://wiki.eclipse.org/Linux_Tools_Project/Docker_Tooling/User_Guide
https://plugins.jetbrains.com/plugin/7724
http://www.sonatype.org/nexus/2015/09/22/docker-and-nexus-3-ready-set-action/
https://github.com/docker/docker/issues/19396
Docker and java, at Montréal JUG

More Related Content

PPTX
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
PPTX
Intro to Docker and clustering with Rancher from scratch
PPTX
Dockerize the World - presentation from Hradec Kralove
PPTX
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
PPT
Amazon Web Services and Docker
PPTX
Dockerfile Basics Workshop #1
PDF
Docker and DevOps --- new IT culture
PDF
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Intro to Docker and clustering with Rancher from scratch
Dockerize the World - presentation from Hradec Kralove
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Amazon Web Services and Docker
Dockerfile Basics Workshop #1
Docker and DevOps --- new IT culture
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia

What's hot (20)

PDF
Docker Continuous Delivery Workshop
PDF
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
PPTX
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
PDF
OpenStack - Docker - Rackspace HQ
PDF
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
PPTX
Dockerize the World
PDF
Docker in pratice -chenyifei
PDF
Joomla Continuous Delivery with Docker
PPTX
Node.js and MongoDB from scratch, fully explained and tested
PDF
Docker worshop @Twitter - How to use your own private registry
PDF
Introduction to Docker
PDF
From development environments to production deployments with Docker, Compose,...
PDF
Dockerizing your applications - Docker workshop @Twitter
PPTX
Docker, LinuX Container
PDF
Docker on Google App Engine
PPTX
Dockerfile basics | docker workshop #1 at Rackspace
PDF
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
PPTX
Intro Docker october 2013
PDF
DockerCon SF 2015: Enabling Microservices @Orbitz
PDF
Docker and the Container Revolution
Docker Continuous Delivery Workshop
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
OpenStack - Docker - Rackspace HQ
PuppetConf 2017: What’s in the Box?!- Leveraging Puppet Enterprise & Docker- ...
Dockerize the World
Docker in pratice -chenyifei
Joomla Continuous Delivery with Docker
Node.js and MongoDB from scratch, fully explained and tested
Docker worshop @Twitter - How to use your own private registry
Introduction to Docker
From development environments to production deployments with Docker, Compose,...
Dockerizing your applications - Docker workshop @Twitter
Docker, LinuX Container
Docker on Google App Engine
Dockerfile basics | docker workshop #1 at Rackspace
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
Intro Docker october 2013
DockerCon SF 2015: Enabling Microservices @Orbitz
Docker and the Container Revolution
Ad

Viewers also liked (20)

PDF
Microservices Minus the Hype: How to Build and Why
PPTX
Top 50 java ee 7 best practices [con5669]
PPTX
Containerless in the Cloud with AWS Lambda
PDF
Securing MicroServices - ConFoo 2017
PDF
Docker and java
PPTX
Faster Java EE Builds with Gradle
PPTX
Get more than a cache back! - ConFoo Montreal
PDF
The Progressive Web and its New Challenges - Confoo Montréal 2017
PDF
Machine Learning on the web - moving from Terminator to Star Trek
PDF
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
PPTX
moscmy2016: Extending Docker
PDF
georchestra SDI: Project Status Report
PDF
Introduction to Docker - Learning containerization XP conference 2016
PDF
PhoneGap Day US 2013 - Simon MacDonald: Speech Recognition
PDF
Using docker to develop NAS applications
PDF
WebShell - confoo 2011 - sean coates
PPTX
Containers for sensor web services, applications and research @ Sensor Web Co...
PDF
Docker for the Brave
PPTX
Hybrid Mobile Development with Apache Cordova and
PDF
Terracotta Ehcache : Simpler, faster, distributed
Microservices Minus the Hype: How to Build and Why
Top 50 java ee 7 best practices [con5669]
Containerless in the Cloud with AWS Lambda
Securing MicroServices - ConFoo 2017
Docker and java
Faster Java EE Builds with Gradle
Get more than a cache back! - ConFoo Montreal
The Progressive Web and its New Challenges - Confoo Montréal 2017
Machine Learning on the web - moving from Terminator to Star Trek
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
moscmy2016: Extending Docker
georchestra SDI: Project Status Report
Introduction to Docker - Learning containerization XP conference 2016
PhoneGap Day US 2013 - Simon MacDonald: Speech Recognition
Using docker to develop NAS applications
WebShell - confoo 2011 - sean coates
Containers for sensor web services, applications and research @ Sensor Web Co...
Docker for the Brave
Hybrid Mobile Development with Apache Cordova and
Terracotta Ehcache : Simpler, faster, distributed
Ad

Similar to Docker and java, at Montréal JUG (20)

PPTX
Cohesion Techsessie Docker - Daniel Palstra
PPTX
Docker SF Meetup January 2016
PDF
Docker Oxford launch - Introduction to Docker
PDF
Dockerizing development workflow
PDF
Docker for dev
PDF
Docker for Developers
PPTX
Docker lxc win
PPTX
DockerCon 15 Keynote - Day 2
PDF
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
PPTX
ma-formation-en-Docker-jlklk,nknkjn.pptx
PPTX
Docker for .net developer
PPTX
Docker for .NET Developers
PDF
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
PDF
Docker
PPTX
Docker Ecosystem on Azure
PDF
codemotion-docker-2014
PPTX
Intro to Docker November 2013
PDF
Docker at Djangocon 2013 | Talk by Ken Cochrane
PDF
Django and Docker
Cohesion Techsessie Docker - Daniel Palstra
Docker SF Meetup January 2016
Docker Oxford launch - Introduction to Docker
Dockerizing development workflow
Docker for dev
Docker for Developers
Docker lxc win
DockerCon 15 Keynote - Day 2
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
ma-formation-en-Docker-jlklk,nknkjn.pptx
Docker for .net developer
Docker for .NET Developers
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
Docker
Docker Ecosystem on Azure
codemotion-docker-2014
Intro to Docker November 2013
Docker at Djangocon 2013 | Talk by Ken Cochrane
Django and Docker

More from Anthony Dahanne (20)

PDF
JDConf 2025 - Paketo Buildpacks : the best way to build Java container images
PPTX
Not a Kubernetes fan? The state of PaaS in 2025
PPTX
No More Dockerfiles! Buildpacks to Help You Ship Your Image!
PDF
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
PPTX
Not a Kubernetes fan? The state of PaaS in 2024
PPTX
No more Dockerfiles? Buildpacks to help you ship your image!
PPTX
CNCF Québec Meetup du 16 Novembre 2023
PDF
Buildpacks: the other way to build container images
PDF
Tu changes d'emploi - retour d'experience d'un développeur
PPTX
Java applications containerized and deployed
PDF
Contribuer à la traduction française de kubernetes
PDF
Get you Java application ready for Kubernetes !
PDF
Kubernetes Java Operator
PDF
Caching in applications still matters
PDF
Kubernetes for java developers - Tutorial at Oracle Code One 2018
PDF
Kubernetes for Java Developers
PDF
Writing a Jenkins / Hudson plugin
PDF
Confoo2013 make your java-app rest enabled
ODP
Ci for-android-apps
ODP
Asynctasks
JDConf 2025 - Paketo Buildpacks : the best way to build Java container images
Not a Kubernetes fan? The state of PaaS in 2025
No More Dockerfiles! Buildpacks to Help You Ship Your Image!
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Not a Kubernetes fan? The state of PaaS in 2024
No more Dockerfiles? Buildpacks to help you ship your image!
CNCF Québec Meetup du 16 Novembre 2023
Buildpacks: the other way to build container images
Tu changes d'emploi - retour d'experience d'un développeur
Java applications containerized and deployed
Contribuer à la traduction française de kubernetes
Get you Java application ready for Kubernetes !
Kubernetes Java Operator
Caching in applications still matters
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for Java Developers
Writing a Jenkins / Hudson plugin
Confoo2013 make your java-app rest enabled
Ci for-android-apps
Asynctasks

Recently uploaded (20)

PDF
Digital Strategies for Manufacturing Companies
PPTX
Transform Your Business with a Software ERP System
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
System and Network Administraation Chapter 3
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
AI in Product Development-omnex systems
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
System and Network Administration Chapter 2
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
top salesforce developer skills in 2025.pdf
PPTX
history of c programming in notes for students .pptx
PPTX
Introduction to Artificial Intelligence
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Digital Strategies for Manufacturing Companies
Transform Your Business with a Software ERP System
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
System and Network Administraation Chapter 3
How to Migrate SBCGlobal Email to Yahoo Easily
How Creative Agencies Leverage Project Management Software.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
AI in Product Development-omnex systems
Understanding Forklifts - TECH EHS Solution
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Navsoft: AI-Powered Business Solutions & Custom Software Development
Internet Downloader Manager (IDM) Crack 6.42 Build 41
System and Network Administration Chapter 2
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
CHAPTER 2 - PM Management and IT Context
top salesforce developer skills in 2025.pdf
history of c programming in notes for students .pptx
Introduction to Artificial Intelligence
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)

Docker and java, at Montréal JUG

  • 1. DOCKER AND JAVA ANTHONY DAHANNE, MONTRÉAL JUG, JANUARY 28TH 2016 @anthonydahanne
  • 2. Anthony Dahanne, Software Engineer @ Terracotta, a Software AG company Working on the Terracotta Management Console, and its integration in Terracotta products And strong Docker supporter :-P , trying to containerize as much as I can ! LET ME INTRODUCE MYSELF We’re hiring Software Engineers ! Contact me !
  • 3. AGENDA • Docker fundamentals : quick recap • Java applications in containers • Hello world from a Java container • SpringBoot app in a container (+ Maven + IntelliJ IDEA integrations) • Java Web Applications (war) Docker pipelines • Docker cloud based CI/CD • CI/CD using on premises familiar tools (Jenkins, Nexus) • Extras • Jenkins container-based slaves • Interacting with Docker from Java with Docker Java
  • 4. VMS VS CONTAINERS IT’S ALL ABOUT THE (LINUX?) KERNEL ! picture from http://www.enterprisetech.com/2014/08/18/ibm-techies-pit-docker-kvm-bare-metal/
  • 5. DOCKER CONTAINERS / IMAGES : A PILE OF LAYERS A DOCKER IMAGE IS A DIFF ON TOP OF ITS PARENT picture from : https://docs.docker.com/v1.6/terms/layer/
  • 6. Host OS Docker daemon Images Containers Docker CLI > docker run ubuntu bash > docker ps > docker images > etc. Docker Compose > docker-compose build > docker-compose up > docker-compose kill > etc. Volumes Kinematic REST API tcp (tls) / Unix socket Host OS Docker daemon Ima ges Conta iners Volum es
  • 7. DOCKER VOCABULARY VS JAVA VOCABULARY • Repository : houses grouped artifacts • Artifact : org.ehcache:ehcache:3.0.0.m4 (+type : jar/sources/etc.) Group id VersionArtifact id
  • 8. DOCKER VOCABULARY VS JAVA VOCABULARY • Registry : hosts repositories • Repositories : house collections of tagged images • Image : localhost:5000/anthony/mycoolimage:v2 DockerHub / quay.io / Registry V2 Registry location Repository name Tag
  • 9. Registry @ SoftwareAG anthony/tmc Registry ubuntu anthonydahanne/terracotta anthonydahanne/petclinic latest 12.04 latest 4.3.1- oss latest 5.0 Host OS Docker CLI Docker daemon Images Host OS Docker daemon Images Docker CLI REST API tcp (tls) / Unix socket
  • 10. DEMO TIME ! • Hello world from a Java container • SpringBoot app in a container (+ Maven + IntelliJ IDEA integrations)
  • 11. DOCKER CLOUD BASED CI/CD PUSH THAT CODE AROUND ! EC2 Azure GCE TutumGithub DockerHub Commit & Push Trigger Automated Build Trigger Redeploy / Scale Create & Start Container
  • 12. DEMO TIME ! • Petclinic cloud based CI/CD • Petclinic built (war + image) by DockerHub • Deployed by Tutum
  • 13. ON PREMISES CI/CD RE USING EXISTING INFRA ! Git Repo Jenkins Commit & Push Trigger mvn job Create & Start Container Docker daemons Regular Slaves Registry Image build Push image to registry Docker daemon
  • 14. DEMO TIME ! • Petclinic built (war and then image) by Jenkins • Pushed to Nexus 3 by Jenkins • Deployed to a machine running Docker by Jenkins
  • 15. EXTRAS JENKINS DOCKER PLUGIN : ADD SLAVES CREATING CONTAINERS
  • 16. EXTRAS INTERACTING WITH DOCKER WITH DOCKER JAVA DockerClient dockerClient = DockerClientBuilder.getInstance(dockerUrl).build(); Info info = dockerClient.infoCmd().exec(); List<Container> containers = dockerClient.listContainersCmd() .withShowAll(false) .exec(); CreateContainerResponse container = dockerClient.createContainerCmd("busybox") .withCmd("touch", "/test") .exec(); dockerClient.startContainerCmd(container.getId()).exec(); dockerClient.stopContainerCmd(container.getId()).exec(); <dependency> <groupId>com.github.docker-java</groupId> <artifactId>docker-java</artifactId> <version>2.1.2</version> </dependency> Demo at : https://github.com/anthonydahanne/montrealjug_docker_java/tree/04_spring_boot_app_docker_api
  • 17. LINKS OF INTERESTS • Presentation links : http://blog.dahanne.net/2016/01/31/docker-and-java-notes-from-the-montreal-jug-presentation/ https://github.com/anthonydahanne/montrealjug_docker_java • Jenkins plugins https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin https://wiki.jenkins-ci.org/display/JENKINS/Support+Core+Plugin https://wiki.jenkins-ci.org/display/JENKINS/Docker+build+step+plugin https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Build+and+Publish+plugin https://updates.jenkins-ci.org/download/plugins/ • DockerHub repositories https://hub.docker.com/_/java/ https://hub.docker.com/_/jenkins/ https://hub.docker.com/_/tomcat/ https://hub.docker.com/_/maven/ https://hub.docker.com/r/anthonydahanne/terracotta-server-oss/ https://hub.docker.com/r/anthonydahanne/jenkins_with_plugins/ • Others https://wiki.eclipse.org/Linux_Tools_Project/Docker_Tooling/User_Guide https://plugins.jetbrains.com/plugin/7724 http://www.sonatype.org/nexus/2015/09/22/docker-and-nexus-3-ready-set-action/ https://github.com/docker/docker/issues/19396