SlideShare a Scribd company logo
1 of 18
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

What's hot

Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
dotCloud
 
OpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQOpenStack - Docker - Rackspace HQ
OpenStack - Docker - Rackspace HQ
dotCloud
 
Docker in pratice -chenyifei
Docker in pratice -chenyifeiDocker in pratice -chenyifei
Docker in pratice -chenyifei
dotCloud
 
Docker on Google App Engine
Docker on Google App EngineDocker on Google App Engine
Docker on Google App Engine
Docker, Inc.
 
Dockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at RackspaceDockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at Rackspace
dotCloud
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
dotCloud
 

What's hot (20)

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

Viewers also liked

Machine Learning on the web - moving from Terminator to Star Trek
Machine Learning on the web - moving from Terminator to Star TrekMachine Learning on the web - moving from Terminator to Star Trek
Machine Learning on the web - moving from Terminator to Star Trek
Christian Heilmann
 
WebShell - confoo 2011 - sean coates
WebShell - confoo 2011 - sean coatesWebShell - confoo 2011 - sean coates
WebShell - confoo 2011 - sean coates
Bachkoutou Toutou
 
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
Ryan Cuprak
 

Viewers also liked (20)

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

Similar to Docker and java, at Montréal JUG

Intro to Docker November 2013
Intro to Docker November 2013Intro to Docker November 2013
Intro to Docker November 2013
Docker, Inc.
 

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

Cohesion Techsessie Docker - Daniel Palstra
Cohesion Techsessie Docker - Daniel PalstraCohesion Techsessie Docker - Daniel Palstra
Cohesion Techsessie Docker - Daniel Palstra
 
Docker SF Meetup January 2016
Docker SF Meetup January 2016Docker SF Meetup January 2016
Docker SF Meetup January 2016
 
Docker Oxford launch - Introduction to Docker
Docker Oxford launch - Introduction to DockerDocker Oxford launch - Introduction to Docker
Docker Oxford launch - Introduction to Docker
 
Dockerizing development workflow
Dockerizing development workflowDockerizing development workflow
Dockerizing development workflow
 
Docker for dev
Docker for devDocker for dev
Docker for dev
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Docker 2014
Docker 2014Docker 2014
Docker 2014
 
Docker lxc win
Docker lxc winDocker lxc win
Docker lxc win
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
Docker for .net developer
Docker for .net developerDocker for .net developer
Docker for .net developer
 
Docker for .NET Developers
Docker for .NET DevelopersDocker for .NET Developers
Docker for .NET Developers
 
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container ServicePlay Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
 
Docker
DockerDocker
Docker
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
Intro to Docker November 2013
Intro to Docker November 2013Intro to Docker November 2013
Intro to Docker November 2013
 
Django and Docker
Django and DockerDjango and Docker
Django and Docker
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
 
Devoxx 2016 - Docker Nuts and Bolts
Devoxx 2016 - Docker Nuts and BoltsDevoxx 2016 - Docker Nuts and Bolts
Devoxx 2016 - Docker Nuts and Bolts
 

More from Anthony Dahanne

Confoo2013 make your java-app rest enabled
Confoo2013 make your java-app rest enabledConfoo2013 make your java-app rest enabled
Confoo2013 make your java-app rest enabled
Anthony Dahanne
 

More from Anthony Dahanne (16)

Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
No more Dockerfiles? Buildpacks to help you ship your image!
No more Dockerfiles? Buildpacks to help you ship your image!No more Dockerfiles? Buildpacks to help you ship your image!
No more Dockerfiles? Buildpacks to help you ship your image!
 
CNCF Québec Meetup du 16 Novembre 2023
CNCF Québec Meetup du 16 Novembre 2023CNCF Québec Meetup du 16 Novembre 2023
CNCF Québec Meetup du 16 Novembre 2023
 
Buildpacks: the other way to build container images
Buildpacks: the other way to build container imagesBuildpacks: the other way to build container images
Buildpacks: the other way to build container images
 
Tu changes d'emploi - retour d'experience d'un développeur
Tu changes d'emploi - retour d'experience d'un développeurTu changes d'emploi - retour d'experience d'un développeur
Tu changes d'emploi - retour d'experience d'un développeur
 
Java applications containerized and deployed
Java applications containerized and deployedJava applications containerized and deployed
Java applications containerized and deployed
 
Contribuer à la traduction française de kubernetes
Contribuer à la traduction française de kubernetesContribuer à la traduction française de kubernetes
Contribuer à la traduction française de kubernetes
 
Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !Get you Java application ready for Kubernetes !
Get you Java application ready for Kubernetes !
 
Kubernetes Java Operator
Kubernetes Java OperatorKubernetes Java Operator
Kubernetes Java Operator
 
Caching in applications still matters
Caching in applications still mattersCaching in applications still matters
Caching in applications still matters
 
Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018Kubernetes for java developers - Tutorial at Oracle Code One 2018
Kubernetes for java developers - Tutorial at Oracle Code One 2018
 
Kubernetes for Java Developers
Kubernetes for Java DevelopersKubernetes for Java Developers
Kubernetes for Java Developers
 
Writing a Jenkins / Hudson plugin
Writing a Jenkins / Hudson pluginWriting a Jenkins / Hudson plugin
Writing a Jenkins / Hudson plugin
 
Confoo2013 make your java-app rest enabled
Confoo2013 make your java-app rest enabledConfoo2013 make your java-app rest enabled
Confoo2013 make your java-app rest enabled
 
Ci for-android-apps
Ci for-android-appsCi for-android-apps
Ci for-android-apps
 
Asynctasks
AsynctasksAsynctasks
Asynctasks
 

Recently uploaded

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Recently uploaded (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 

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