On Thursday the 28th of January 2016, Anthony Dahanne gave a talk on how to leverage Docker to package Java applications.
After a quick introduction to Docker principles, Anthony showed some demos (available on github) on how to create Docker images for simple and not so simple Java webapps.
Then, he went on with CI/CD examples, and finished with a quick intro to the Docker Java API.
http://blog.dahanne.net/2016/01/31/docker-and-java-notes-from-the-montreal-jug-presentation/
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