SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
FORFOR
(JAVA)(JAVA) DEVELOPERSDEVELOPERS
RAFAEL BENEVIDES
@RAFABENE@RAFABENE
1. Docker concepts
2. Creating docker hosts with docker-machine
3. Running docker
4. Creating docker images
5. Running an Application Server in Docker
6. Changing container behaviour
7. 3 ways to deploy an application
8. Composing with docker-compose
9. docker-swarm overview
10. Questions?
AGENDA
Who am I ?
My name is Rafael Benevides
I work for Red Hat since 2009
JBoss Developer Materials lead
Apache DeltaSpike PMC member
Middleware DevOps "guy"
Some facts about me
“ My work consists to help developers
worldwide to be more effective in software
development and promote tools and
practices that help them to be more
productive."e-mail: benevides@redhat.com
Twitter: @rafabene
DISCLAIMER
This presentation should take 45 minutes
It will be 80% live-coding
It won't cover "What is docker?",
"Installing docker", "Motivations to use
docker" topics
But you will see/learn how to use docker
and take you own conclusions about the
motivations to start using it.
Docker Hello world
Docker
Client
Docker
Hub
Docker Host
Daemon
Image 1
Image 2
Image 3
Image 1
Image 2
Image 3
Container 1
Container 2
docker run <image x>
docker run hello-world
docker run <image x>
unix:///var/run/docker.sock
Docker Machine
A L L O W S T H E C R E A T I O N O F D O C K E R H O S T SA L L O W S T H E C R E A T I O N O F D O C K E R H O S T S
DRIVERSDRIVERS
1. AWS - Amazon Web Services
2. Digital Ocean
3. Exoscale
4. Generic ( Fedora, RHEL, CentOS, ... )
5. GCE - Google Compute Enginer
6. IBM Softlayer
7. Microsoft Azure / Hyper-V
8. OpenStack
9. Oracle VirtualBox
10. Rackspace
11. VMware Fusion / vCloud Air / vSphere
USEFUL COMMANDSUSEFUL COMMANDS
docker-machine create -d <driver> <name>
docker-machine ls
docker env <name>
ENV VARSENV VARS
DOCKER_TLS_VERIFY
DOCKER_HOST
DOCKER_CERT_PATH
DOCKER_MACHINE_NAME
Docker commands
DOCKER RUNDOCKER RUN
Creates a new container
docker run <image> command
docker run -it <image> command
docker run --name -it <image> command
docker run --name --rm -it <image> command
docker run -d fedora /bin/bash -c "while true; do echo
hello world; sleep 1; done"
Docker commands
OT HE R DOCK ER COMMANDSOT HE R DOCK ER COMMANDS
docker ps / docker ps -a
docker stop <container> / docker stop -t=1 <container>
docker rm <container> / docker rm `docker ps -aq`
docker logs <container> / docker logs -f <container>
docker attach <container>
docker stats <container>
2 Ways to create Docker Images
COMMIT WAYCOMMIT WAY
docker commit -m "<menssage>" <image name>
docker history <image name>
DOCKERFILE WAYDOCKERFILE WAY
docker build -t <tag> <dockerfile path>
DOCKERFILE REFDOCKERFILE REF
FROM
MAINTAINER
WORKDIR
ENV
RUN
COPY
ADD
EXPOSE
VOLUME
USER
CMD
Dockerfile anatomy
# Use latest jboss/base-jdk:7 image as the base
FROM jboss/base-jdk:8
# Set the WILDFLY_VERSION env variable
ENV WILDFLY_VERSION 9.0.0.Final
# Add the WildFly distribution to /opt, and make wildfly the owner of the extracted tar content
# Make sure the distribution is available from a well-known place
RUN cd $HOME && curl http://download.jboss.org/wildfly/$WILDFLY_VERSION/wildfly-$WILDFLY_VERSION.tar.gz | tar zx &
# Set the JBOSS_HOME env variable
ENV JBOSS_HOME /opt/jboss/wildfly
# Expose the ports we're interested in
EXPOSE 8080
# Set the default command to run on boot
# This will boot WildFly in the standalone mode and bind to all interface
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0"]
WildFly Image example
Changing container behaviour
CHANGING ENV VARCHANGING ENV VAR
docker run -e ...
EXPOSING PORTSEXPOSING PORTS
docker run -P ...
docker run -p <host:container> ...
docker-machine ip
MOUTING VOLUMESMOUTING VOLUMES
docker run -v <host:container> ...
3 Ways to deploy an application
1 - MOUNTING A VOLUME1 - MOUNTING A VOLUME
docker run -v <host:container> ...
2 - ADMINISTRATIVE CONSOLE2 - ADMINISTRATIVE CONSOLE
docker run -p <host:port> ...
3 - INCLUDE INSIDE THE IMAGE3 - INCLUDE INSIDE THE IMAGE
Dockerfile
ADD your-awesome-app.war /opt/jboss/wildfly/standalone/deployments/
Cluster example
Apache HTTPD
+ mod_cluster
Postgres
database
WildFly instances
Linking containers
[ jboss@22ac4068f95f ~]$ cat /etc/hosts
172.17.0.50 22ac4068f95f
127.0.0.1 localhost
172.17.0.43 db 84e9fc3e4455
172.17.0.44 modcluster 13784a898c33
Environment Variables
$DB_NAME
$DB_ENV_LANG
$DB_ENV_PG_VERSION
$DB_ENV_PGDATA
$DB_ENV_POSTGRES_PASSWORD
$DB_ENV_PG_MAJOR
$DB_ENV_POSTGRES_USER
$DB_PORT
$DB_PORT_5432_TCP
$DB_PORT_5432_TCP_PROTO
$DB_PORT_5432_TCP_ADDR
$DB_PORT_5432_TCP_PORT
$MODCLUSTER_NAME
$MODCLUSTER_PORT_80_TCP
$MODCLUSTER_PORT_80_TCP_PORT
$MODCLUSTER_PORT
$MODCLUSTER_PORT_80_TCP_ADDR
$MODCLUSTER_PORT_80_TCP_PROTO
docker run --link <container_name:alias>
Docker compose
docker-compose.yaml
db:
image: postgres
ports:
- "5432:5432"
environment:
- POSTGRES_USER=ticketmonster
- POSTGRES_PASSWORD=ticketmonster-docker
modcluster:
image: goldmann/mod_cluster
ports:
- "80:80"
wildfly:
build: ../Dockerfiles/ticketmonster/
links:
- db:db
- modcluster:modcluster
docker-compose up -d
docker-compose ps
docker-compose logs
docker-compose build
docker-compose scale <service>=x
DISCLAIMER
You're about to see an overview of docker-
swarm
Some issues found:
machine restart
cross-host linking
Docker Swarm
Discovery Services
Docker Hub
Static file
Static list
etcd
consul
zookeeper
Creating a Docker Swarm
echo "Creating cluster ..."
TOKEN=`docker run swarm create`
echo "Got the token " $TOKEN
echo "Creating Swarm master ..."
docker-machine create -d virtualbox --swarm --swarm-master
--swarm-strategy=spread
--swarm-discovery token://$TOKEN swarm-master
echo "Creating Swarm node 01 ..."
docker-machine create -d virtualbox --swarm
--swarm-discovery token://$TOKEN swarm-node-01
echo "Creating Swarm node 02 ..."
docker-machine create -d virtualbox --swarm
--swarm-discovery token://$TOKEN swarm-node-02
eval "$(docker-machine env --swarm swarm-master)"
Strategy
spread*
binpack
random
Kubernetes
Github code
https://github.com
/rafabene
/devops-demo
THANK YOU!THANK YOU!
RAFAEL BENEVIDESRAFAEL BENEVIDES
BENEVIDES@REDHAT.COMBENEVIDES@REDHAT.COM
@RAFABENE@RAFABENE

Weitere ähnliche Inhalte

Was ist angesagt?

A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEMario-Leander Reimer
 
Containerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaContainerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaJadson Santos
 
Kubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with PodmanKubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with PodmanMihai Criveti
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境謝 宗穎
 
Continuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsContinuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsFrancesco Bruni
 
Kubelet with no Kubernetes Masters | DevNation Tech Talk
Kubelet with no Kubernetes Masters | DevNation Tech TalkKubelet with no Kubernetes Masters | DevNation Tech Talk
Kubelet with no Kubernetes Masters | DevNation Tech TalkRed Hat Developers
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To RunningGiacomo Vacca
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutesLarry Cai
 
Dockerize Laravel Application
Dockerize Laravel ApplicationDockerize Laravel Application
Dockerize Laravel ApplicationAfrimadoni Dinata
 
Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Will Hall
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chefMukta Aphale
 
Deploying Apache Kylin on AWS and designing a task scheduler for it
Deploying Apache Kylin on AWS and designing a task scheduler for itDeploying Apache Kylin on AWS and designing a task scheduler for it
Deploying Apache Kylin on AWS and designing a task scheduler for itChase Zhang
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for DevelopersAntons Kranga
 
Continuous Integration and Kamailio
Continuous Integration and KamailioContinuous Integration and Kamailio
Continuous Integration and KamailioGiacomo Vacca
 
Docker in production: reality, not hype (OSCON 2015)
Docker in production: reality, not hype (OSCON 2015)Docker in production: reality, not hype (OSCON 2015)
Docker in production: reality, not hype (OSCON 2015)bridgetkromhout
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Ontico
 
Using Kubernetes for Continuous Integration and Continuous Delivery
Using Kubernetes for Continuous Integration and Continuous DeliveryUsing Kubernetes for Continuous Integration and Continuous Delivery
Using Kubernetes for Continuous Integration and Continuous DeliveryCarlos Sanchez
 
Docker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopDocker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopJirayut Nimsaeng
 
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014ahunnargikar
 

Was ist angesagt? (20)

A Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EEA Hitchhiker's Guide to Cloud Native Java EE
A Hitchhiker's Guide to Cloud Native Java EE
 
Containerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and JavaContainerizing a Web Application with Vue.js and Java
Containerizing a Web Application with Vue.js and Java
 
Kubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with PodmanKubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with Podman
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
 
Continuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsContinuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and Jenkins
 
Kubelet with no Kubernetes Masters | DevNation Tech Talk
Kubelet with no Kubernetes Masters | DevNation Tech TalkKubelet with no Kubernetes Masters | DevNation Tech Talk
Kubelet with no Kubernetes Masters | DevNation Tech Talk
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Docker - From Walking To Running
Docker - From Walking To RunningDocker - From Walking To Running
Docker - From Walking To Running
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
 
Dockerize Laravel Application
Dockerize Laravel ApplicationDockerize Laravel Application
Dockerize Laravel Application
 
Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
Deploying Apache Kylin on AWS and designing a task scheduler for it
Deploying Apache Kylin on AWS and designing a task scheduler for itDeploying Apache Kylin on AWS and designing a task scheduler for it
Deploying Apache Kylin on AWS and designing a task scheduler for it
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Continuous Integration and Kamailio
Continuous Integration and KamailioContinuous Integration and Kamailio
Continuous Integration and Kamailio
 
Docker in production: reality, not hype (OSCON 2015)
Docker in production: reality, not hype (OSCON 2015)Docker in production: reality, not hype (OSCON 2015)
Docker in production: reality, not hype (OSCON 2015)
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
Using Kubernetes for Continuous Integration and Continuous Delivery
Using Kubernetes for Continuous Integration and Continuous DeliveryUsing Kubernetes for Continuous Integration and Continuous Delivery
Using Kubernetes for Continuous Integration and Continuous Delivery
 
Docker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopDocker Continuous Delivery Workshop
Docker Continuous Delivery Workshop
 
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
 

Andere mochten auch

JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platformsPayara
 
Microservices Platforms - Which is Best?
Microservices Platforms - Which is Best?Microservices Platforms - Which is Best?
Microservices Platforms - Which is Best?Payara
 
JavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io PresentationJavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io Presentationmanolitto
 
Joomladay Netherlands 2012 - Joomla in the Cloud
Joomladay Netherlands 2012  - Joomla in the CloudJoomladay Netherlands 2012  - Joomla in the Cloud
Joomladay Netherlands 2012 - Joomla in the CloudJohan Janssens
 
JavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toJavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toNicolas Fränkel
 
Developing JavaEE 7 based apps with Payara Micro
Developing JavaEE 7 based apps with Payara MicroDeveloping JavaEE 7 based apps with Payara Micro
Developing JavaEE 7 based apps with Payara MicroPayara
 
Useful Design Patterns for Enterprise Applications with Java
Useful Design Patterns for Enterprise Applications with JavaUseful Design Patterns for Enterprise Applications with Java
Useful Design Patterns for Enterprise Applications with JavaPT.JUG
 
Deploying Elastic Java EE Microservices in the Cloud with Docker
Deploying Elastic Java EE Microservices in the Cloud with DockerDeploying Elastic Java EE Microservices in the Cloud with Docker
Deploying Elastic Java EE Microservices in the Cloud with DockerPayara
 
JavaEE Microservices -the Payara Way
JavaEE Microservices -the Payara WayJavaEE Microservices -the Payara Way
JavaEE Microservices -the Payara WayPayara
 
Developing Java EE applications with NetBeans and Payara
Developing Java EE applications with NetBeans and PayaraDeveloping Java EE applications with NetBeans and Payara
Developing Java EE applications with NetBeans and PayaraPayara
 
Microservices
MicroservicesMicroservices
MicroservicesPT.JUG
 
Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Boris Kravtsov
 
Developing Microservices with Apache Camel, by Claus Ibsen
Developing Microservices with Apache Camel, by Claus IbsenDeveloping Microservices with Apache Camel, by Claus Ibsen
Developing Microservices with Apache Camel, by Claus IbsenJudy Breedlove
 
Monitoring Highly Dynamic and Distributed Systems with NGINX Amplify
Monitoring Highly Dynamic and Distributed Systems with NGINX AmplifyMonitoring Highly Dynamic and Distributed Systems with NGINX Amplify
Monitoring Highly Dynamic and Distributed Systems with NGINX AmplifyNGINX, Inc.
 
Continuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applicationsContinuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applicationsSunil Dalal
 
Integration Testing with Docker Containers with DockerCompose
Integration Testing with Docker Containers  with DockerComposeIntegration Testing with Docker Containers  with DockerCompose
Integration Testing with Docker Containers with DockerComposeMike Holdsworth
 
High performance java ee with j cache and cdi
High performance java ee with j cache and cdiHigh performance java ee with j cache and cdi
High performance java ee with j cache and cdiPayara
 
Badass Microservices - deploy, build & scale your apps with Payara Micro
Badass Microservices - deploy, build & scale your apps with Payara MicroBadass Microservices - deploy, build & scale your apps with Payara Micro
Badass Microservices - deploy, build & scale your apps with Payara MicroPayara
 
JPA 2.1 on Payara Server
JPA 2.1 on Payara ServerJPA 2.1 on Payara Server
JPA 2.1 on Payara ServerPayara
 

Andere mochten auch (20)

JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platforms
 
Microservices Platforms - Which is Best?
Microservices Platforms - Which is Best?Microservices Platforms - Which is Best?
Microservices Platforms - Which is Best?
 
JavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io PresentationJavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io Presentation
 
Joomladay Netherlands 2012 - Joomla in the Cloud
Joomladay Netherlands 2012  - Joomla in the CloudJoomladay Netherlands 2012  - Joomla in the Cloud
Joomladay Netherlands 2012 - Joomla in the Cloud
 
JavaLand - Integration Testing How-to
JavaLand - Integration Testing How-toJavaLand - Integration Testing How-to
JavaLand - Integration Testing How-to
 
Developing JavaEE 7 based apps with Payara Micro
Developing JavaEE 7 based apps with Payara MicroDeveloping JavaEE 7 based apps with Payara Micro
Developing JavaEE 7 based apps with Payara Micro
 
Useful Design Patterns for Enterprise Applications with Java
Useful Design Patterns for Enterprise Applications with JavaUseful Design Patterns for Enterprise Applications with Java
Useful Design Patterns for Enterprise Applications with Java
 
Deploying Elastic Java EE Microservices in the Cloud with Docker
Deploying Elastic Java EE Microservices in the Cloud with DockerDeploying Elastic Java EE Microservices in the Cloud with Docker
Deploying Elastic Java EE Microservices in the Cloud with Docker
 
JavaEE Microservices -the Payara Way
JavaEE Microservices -the Payara WayJavaEE Microservices -the Payara Way
JavaEE Microservices -the Payara Way
 
Developing Java EE applications with NetBeans and Payara
Developing Java EE applications with NetBeans and PayaraDeveloping Java EE applications with NetBeans and Payara
Developing Java EE applications with NetBeans and Payara
 
Microservices
MicroservicesMicroservices
Microservices
 
Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...Automated integration testing of distributed systems with Docker Compose and ...
Automated integration testing of distributed systems with Docker Compose and ...
 
Developing Microservices with Apache Camel, by Claus Ibsen
Developing Microservices with Apache Camel, by Claus IbsenDeveloping Microservices with Apache Camel, by Claus Ibsen
Developing Microservices with Apache Camel, by Claus Ibsen
 
Monitoring Highly Dynamic and Distributed Systems with NGINX Amplify
Monitoring Highly Dynamic and Distributed Systems with NGINX AmplifyMonitoring Highly Dynamic and Distributed Systems with NGINX Amplify
Monitoring Highly Dynamic and Distributed Systems with NGINX Amplify
 
Continuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applicationsContinuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applications
 
Integration Testing with Docker Containers with DockerCompose
Integration Testing with Docker Containers  with DockerComposeIntegration Testing with Docker Containers  with DockerCompose
Integration Testing with Docker Containers with DockerCompose
 
High performance java ee with j cache and cdi
High performance java ee with j cache and cdiHigh performance java ee with j cache and cdi
High performance java ee with j cache and cdi
 
Just enough app server
Just enough app serverJust enough app server
Just enough app server
 
Badass Microservices - deploy, build & scale your apps with Payara Micro
Badass Microservices - deploy, build & scale your apps with Payara MicroBadass Microservices - deploy, build & scale your apps with Payara Micro
Badass Microservices - deploy, build & scale your apps with Payara Micro
 
JPA 2.1 on Payara Server
JPA 2.1 on Payara ServerJPA 2.1 on Payara Server
JPA 2.1 on Payara Server
 

Ähnlich wie Docker for (Java) Developers

時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇Philip Zheng
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruSwaminathan Vetri
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Ben Hall
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Paul Chao
 
手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇Philip Zheng
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Alessandro Mignogna
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안양재동 코드랩
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Developmentmsyukor
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationErica Windisch
 
Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshopRuncy Oommen
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with dockerMichelle Liu
 
Docker in Action
Docker in ActionDocker in Action
Docker in ActionAlper Kanat
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Partner S.A.
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsBen Hall
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班Philip Zheng
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageAlessandro Cinelli (cirpo)
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班Paul Chao
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerGuido Schmutz
 
Docker workshop
Docker workshopDocker workshop
Docker workshopEvans Ye
 

Ähnlich wie Docker for (Java) Developers (20)

時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
How to _docker
How to _dockerHow to _docker
How to _docker
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
 
手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇手把手帶你學 Docker 入門篇
手把手帶你學 Docker 入門篇
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021
 
[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안[Codelab 2017] Docker 기초 및 활용 방안
[Codelab 2017] Docker 기초 및 활용 방안
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
 
Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshop
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with docker
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stage
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker Container
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 

Mehr von Rafael Benevides

JavaOne 2016: Kubernetes introduction for Java Developers
JavaOne 2016: Kubernetes introduction for Java Developers JavaOne 2016: Kubernetes introduction for Java Developers
JavaOne 2016: Kubernetes introduction for Java Developers Rafael Benevides
 
Microservices with Kubernetes, Docker, and Jenkins
Microservices with Kubernetes, Docker, and JenkinsMicroservices with Kubernetes, Docker, and Jenkins
Microservices with Kubernetes, Docker, and JenkinsRafael Benevides
 
JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...
JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...
JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...Rafael Benevides
 
CDI Extensions e DeltaSpike
CDI Extensions e DeltaSpikeCDI Extensions e DeltaSpike
CDI Extensions e DeltaSpikeRafael Benevides
 
TDC 2014 SP - E o DeltaSpike ?
TDC 2014 SP - E o DeltaSpike ?TDC 2014 SP - E o DeltaSpike ?
TDC 2014 SP - E o DeltaSpike ?Rafael Benevides
 
Reunião SouJava BSB - 2005 - Java a favor do consumidor brasileiro
Reunião SouJava BSB - 2005 - Java a favor do consumidor brasileiro Reunião SouJava BSB - 2005 - Java a favor do consumidor brasileiro
Reunião SouJava BSB - 2005 - Java a favor do consumidor brasileiro Rafael Benevides
 
Apostilava Java EE 5 - 2007
Apostilava Java EE 5 - 2007Apostilava Java EE 5 - 2007
Apostilava Java EE 5 - 2007Rafael Benevides
 
Red Hat Roadshow 2009 - Drools
Red Hat Roadshow 2009 - DroolsRed Hat Roadshow 2009 - Drools
Red Hat Roadshow 2009 - DroolsRafael Benevides
 

Mehr von Rafael Benevides (11)

JavaOne 2016: Kubernetes introduction for Java Developers
JavaOne 2016: Kubernetes introduction for Java Developers JavaOne 2016: Kubernetes introduction for Java Developers
JavaOne 2016: Kubernetes introduction for Java Developers
 
Microservices with Kubernetes, Docker, and Jenkins
Microservices with Kubernetes, Docker, and JenkinsMicroservices with Kubernetes, Docker, and Jenkins
Microservices with Kubernetes, Docker, and Jenkins
 
JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...
JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...
JavaOne 2016: The Deploy Master: From Basic to Zero Downtime, Blue/Green, A/B...
 
CDI Extensions e DeltaSpike
CDI Extensions e DeltaSpikeCDI Extensions e DeltaSpike
CDI Extensions e DeltaSpike
 
TDC 2014 SP - E o DeltaSpike ?
TDC 2014 SP - E o DeltaSpike ?TDC 2014 SP - E o DeltaSpike ?
TDC 2014 SP - E o DeltaSpike ?
 
Reunião SouJava BSB - 2005 - Java a favor do consumidor brasileiro
Reunião SouJava BSB - 2005 - Java a favor do consumidor brasileiro Reunião SouJava BSB - 2005 - Java a favor do consumidor brasileiro
Reunião SouJava BSB - 2005 - Java a favor do consumidor brasileiro
 
Apostilava Java EE 5 - 2007
Apostilava Java EE 5 - 2007Apostilava Java EE 5 - 2007
Apostilava Java EE 5 - 2007
 
TDC 2012 - JDF
TDC 2012 - JDFTDC 2012 - JDF
TDC 2012 - JDF
 
JBossInBossa 2011 - BRMS
JBossInBossa 2011 - BRMSJBossInBossa 2011 - BRMS
JBossInBossa 2011 - BRMS
 
JBossinBossa 2010 - Seam
JBossinBossa 2010 -  SeamJBossinBossa 2010 -  Seam
JBossinBossa 2010 - Seam
 
Red Hat Roadshow 2009 - Drools
Red Hat Roadshow 2009 - DroolsRed Hat Roadshow 2009 - Drools
Red Hat Roadshow 2009 - Drools
 

Kürzlich hochgeladen

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 

Kürzlich hochgeladen (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 

Docker for (Java) Developers

  • 2. 1. Docker concepts 2. Creating docker hosts with docker-machine 3. Running docker 4. Creating docker images 5. Running an Application Server in Docker 6. Changing container behaviour 7. 3 ways to deploy an application 8. Composing with docker-compose 9. docker-swarm overview 10. Questions? AGENDA
  • 3. Who am I ? My name is Rafael Benevides I work for Red Hat since 2009 JBoss Developer Materials lead Apache DeltaSpike PMC member Middleware DevOps "guy" Some facts about me “ My work consists to help developers worldwide to be more effective in software development and promote tools and practices that help them to be more productive."e-mail: benevides@redhat.com Twitter: @rafabene
  • 4. DISCLAIMER This presentation should take 45 minutes It will be 80% live-coding It won't cover "What is docker?", "Installing docker", "Motivations to use docker" topics But you will see/learn how to use docker and take you own conclusions about the motivations to start using it.
  • 5. Docker Hello world Docker Client Docker Hub Docker Host Daemon Image 1 Image 2 Image 3 Image 1 Image 2 Image 3 Container 1 Container 2 docker run <image x> docker run hello-world docker run <image x> unix:///var/run/docker.sock
  • 6. Docker Machine A L L O W S T H E C R E A T I O N O F D O C K E R H O S T SA L L O W S T H E C R E A T I O N O F D O C K E R H O S T S DRIVERSDRIVERS 1. AWS - Amazon Web Services 2. Digital Ocean 3. Exoscale 4. Generic ( Fedora, RHEL, CentOS, ... ) 5. GCE - Google Compute Enginer 6. IBM Softlayer 7. Microsoft Azure / Hyper-V 8. OpenStack 9. Oracle VirtualBox 10. Rackspace 11. VMware Fusion / vCloud Air / vSphere USEFUL COMMANDSUSEFUL COMMANDS docker-machine create -d <driver> <name> docker-machine ls docker env <name> ENV VARSENV VARS DOCKER_TLS_VERIFY DOCKER_HOST DOCKER_CERT_PATH DOCKER_MACHINE_NAME
  • 7. Docker commands DOCKER RUNDOCKER RUN Creates a new container docker run <image> command docker run -it <image> command docker run --name -it <image> command docker run --name --rm -it <image> command docker run -d fedora /bin/bash -c "while true; do echo hello world; sleep 1; done"
  • 8. Docker commands OT HE R DOCK ER COMMANDSOT HE R DOCK ER COMMANDS docker ps / docker ps -a docker stop <container> / docker stop -t=1 <container> docker rm <container> / docker rm `docker ps -aq` docker logs <container> / docker logs -f <container> docker attach <container> docker stats <container>
  • 9. 2 Ways to create Docker Images COMMIT WAYCOMMIT WAY docker commit -m "<menssage>" <image name> docker history <image name> DOCKERFILE WAYDOCKERFILE WAY docker build -t <tag> <dockerfile path> DOCKERFILE REFDOCKERFILE REF FROM MAINTAINER WORKDIR ENV RUN COPY ADD EXPOSE VOLUME USER CMD
  • 10. Dockerfile anatomy # Use latest jboss/base-jdk:7 image as the base FROM jboss/base-jdk:8 # Set the WILDFLY_VERSION env variable ENV WILDFLY_VERSION 9.0.0.Final # Add the WildFly distribution to /opt, and make wildfly the owner of the extracted tar content # Make sure the distribution is available from a well-known place RUN cd $HOME && curl http://download.jboss.org/wildfly/$WILDFLY_VERSION/wildfly-$WILDFLY_VERSION.tar.gz | tar zx & # Set the JBOSS_HOME env variable ENV JBOSS_HOME /opt/jboss/wildfly # Expose the ports we're interested in EXPOSE 8080 # Set the default command to run on boot # This will boot WildFly in the standalone mode and bind to all interface CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0"] WildFly Image example
  • 11. Changing container behaviour CHANGING ENV VARCHANGING ENV VAR docker run -e ... EXPOSING PORTSEXPOSING PORTS docker run -P ... docker run -p <host:container> ... docker-machine ip MOUTING VOLUMESMOUTING VOLUMES docker run -v <host:container> ...
  • 12. 3 Ways to deploy an application 1 - MOUNTING A VOLUME1 - MOUNTING A VOLUME docker run -v <host:container> ... 2 - ADMINISTRATIVE CONSOLE2 - ADMINISTRATIVE CONSOLE docker run -p <host:port> ... 3 - INCLUDE INSIDE THE IMAGE3 - INCLUDE INSIDE THE IMAGE Dockerfile ADD your-awesome-app.war /opt/jboss/wildfly/standalone/deployments/
  • 13. Cluster example Apache HTTPD + mod_cluster Postgres database WildFly instances
  • 14. Linking containers [ jboss@22ac4068f95f ~]$ cat /etc/hosts 172.17.0.50 22ac4068f95f 127.0.0.1 localhost 172.17.0.43 db 84e9fc3e4455 172.17.0.44 modcluster 13784a898c33 Environment Variables $DB_NAME $DB_ENV_LANG $DB_ENV_PG_VERSION $DB_ENV_PGDATA $DB_ENV_POSTGRES_PASSWORD $DB_ENV_PG_MAJOR $DB_ENV_POSTGRES_USER $DB_PORT $DB_PORT_5432_TCP $DB_PORT_5432_TCP_PROTO $DB_PORT_5432_TCP_ADDR $DB_PORT_5432_TCP_PORT $MODCLUSTER_NAME $MODCLUSTER_PORT_80_TCP $MODCLUSTER_PORT_80_TCP_PORT $MODCLUSTER_PORT $MODCLUSTER_PORT_80_TCP_ADDR $MODCLUSTER_PORT_80_TCP_PROTO docker run --link <container_name:alias>
  • 15. Docker compose docker-compose.yaml db: image: postgres ports: - "5432:5432" environment: - POSTGRES_USER=ticketmonster - POSTGRES_PASSWORD=ticketmonster-docker modcluster: image: goldmann/mod_cluster ports: - "80:80" wildfly: build: ../Dockerfiles/ticketmonster/ links: - db:db - modcluster:modcluster docker-compose up -d docker-compose ps docker-compose logs docker-compose build docker-compose scale <service>=x
  • 16. DISCLAIMER You're about to see an overview of docker- swarm Some issues found: machine restart cross-host linking
  • 17. Docker Swarm Discovery Services Docker Hub Static file Static list etcd consul zookeeper
  • 18. Creating a Docker Swarm echo "Creating cluster ..." TOKEN=`docker run swarm create` echo "Got the token " $TOKEN echo "Creating Swarm master ..." docker-machine create -d virtualbox --swarm --swarm-master --swarm-strategy=spread --swarm-discovery token://$TOKEN swarm-master echo "Creating Swarm node 01 ..." docker-machine create -d virtualbox --swarm --swarm-discovery token://$TOKEN swarm-node-01 echo "Creating Swarm node 02 ..." docker-machine create -d virtualbox --swarm --swarm-discovery token://$TOKEN swarm-node-02 eval "$(docker-machine env --swarm swarm-master)" Strategy spread* binpack random
  • 21. THANK YOU!THANK YOU! RAFAEL BENEVIDESRAFAEL BENEVIDES BENEVIDES@REDHAT.COMBENEVIDES@REDHAT.COM @RAFABENE@RAFABENE