SlideShare a Scribd company logo
1 of 22
Module 10: Docker Compose
Docker Workshop
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
Agenda
What is docker compose?
Features
Installation
YML File for docker compose
Commands
Lab 10: Simple Docker Compose
Dive into the YML File
Lab 11: Docker Compose
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
What is docker compose?
Define a multi-container application in a
single file
Spin your application up in a single command
Docker Compose is a tool for defining and
running complex applications with Docker.
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
Features
Preserve volume data when containers are created
Only recreate containers that have changed
Multiple isolated environments on a single host
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
Variables and moving a composition between environments
Multiple compose files
Installation
Linux:
Windows / Mac - Docker Compose is included 
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
sudo curl -L
https://github.com/docker/compose/releases/download/1.21.2/docker-
compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
Test the installation
Before Docker Compose
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
$ docker run -d -it --name redis redis
$ docker run -d -it --name postgres linhmtran168/postgres
$ docker run -d -it --name web  -v
~/Dev/gitlab.com/linhmtran168/test-project:/var/www/html  --link
postgres:db --link redis:redis linhmtran168/php-web
$ docker run -d -it -p 80:80 --name nginx  --link web:web --volumes-
from web linhmtran168/php-nginx
$ docker run -d -it --name node --link web:web  --volumes-from web
linhmtran168/gulp-bower
After Docker Compose
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
web:
build: .
links:
- redis:redis
- postgres:db
volumes:
- .:/var/www/html
nginx:
build: ../docker-php-nginx
ports:
- "80:80"
links:
- web:web
volumes_from:
- web
YML File
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
Networks
Volumes
Services
Build
Image
Environment
Ports
Volumes
Version
Simple YML File
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
version: '3'
services:
jenkins:
image: jenkins/jenkins:lts
ports:
- “8080:8080”
- “50000:50000”
artifactory:
image: docker.bintray.io/jfrog/artifactory-oss:latest
ports:
- 8081:8081
Commands
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
Sets the number of containers:
List all the containers belong to the compose environment instance:
Create and start all the containers listed in the “docker-compose.yml”
$ docker-compose up -d
$ docker-compose scale web=3
$ docker-compose ps
Commands
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
build Build or rebuild services
help Get help on a command
kill Kill containers
logs View output from containers
port Print the public port for a port binding
ps List containers
pull Pulls service images
rm Remove stopped containers
run Run a one-off command
scale Set number of containers for a service
start Start services
stop Stop services
restart Restart services
up Create and start containers
Demo
Docker Compose
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | DevOps Course | Leon Jalfon – leonj@sela.co.il
Lab
Lab 10: Simple Docker Compose
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
https://gitlab.com/docker-workshop/Lab-11
Dive into the YML File
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
image: jenkins/jenkins:lts
build: ./dir
Image / Build version: '3'
services:
jenkins:
image: jenkins/jenkins:lts
ports:
- “8080:8080”
- “50000:50000”
myapp:
build: ./dir
Dive into the YML File
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
web:
build: .
depends_on:
- db
- redis
Depends_on version: '3'
services:
web:
build: .
depends_on:
- db
- redis
Dive into the YML File
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
restart: "no"
restart: always
restart: on-failure
restart: unless-stopped
Restart version: '3'
services:
jenkins:
image: jenkins/jenkins:lts
ports:
- “8080:8080”
- “50000:50000”
restart: alwayes
Dive into the YML File
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
Environment
Environment File
env_file: .env
version: '3'
services:
jenkins:
image: jenkins/jenkins:lts
ports:
- “8080:8080”
- “50000:50000”
restart: always
environment:
MYSQL_USER: wordpress
env_file: .env
Dive into the YML File
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
web:
networks:
- sela
Networks
networks:
sela:
other:
version: '3'
services:
jenkins:
image: jenkins/jenkins:lts
ports:
- “8080:8080”
- “50000:50000”
restart: always
environment:
MYSQL_USER: wordpress
networks:
- sela
networks:
sela:
other:
Dive into the YML File
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
volumes:
- "dbdata:/var/lib/postgresql/data"
Volumes
volumes :
dbdata:
version: '3'
services:
jenkins:
image: jenkins/jenkins:lts
ports:
- “8080:8080”
- “50000:50000”
restart: always
environment:
MYSQL_USER: wordpress
networks:
- sela
volumes:
- dbdata:/var/lib/postgresql/data
networks:
sela:
other:
Volumes:
dbdata:
Demo
Docker Compose
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | DevOps Course | Leon Jalfon – leonj@sela.co.il
Lab
Lab 11: Docker Compose
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
https://gitlab.com/docker-workshop/Lab-12
Questions
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj

More Related Content

Similar to Módulo de docker compose para ensino e aprendizagem do yml para docker

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
 
Building and Customizing CoreOS
Building and Customizing CoreOSBuilding and Customizing CoreOS
Building and Customizing CoreOS雄也 日下部
 
Oracle obiee-11-installation-guide 11.1.1.6.0
Oracle obiee-11-installation-guide 11.1.1.6.0Oracle obiee-11-installation-guide 11.1.1.6.0
Oracle obiee-11-installation-guide 11.1.1.6.0Aadiseshu Immadisetty
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peekmsyukor
 
Developer-Friendly CI / CD for Kubernetes
Developer-Friendly CI / CD for KubernetesDeveloper-Friendly CI / CD for Kubernetes
Developer-Friendly CI / CD for KubernetesDevOps Indonesia
 
猿でもわかるコンテナ・オーケストレーション
猿でもわかるコンテナ・オーケストレーション猿でもわかるコンテナ・オーケストレーション
猿でもわかるコンテナ・オーケストレーションTsuyoshi Miyake
 
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
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudSalesforce Developers
 
Docker & rancher
Docker & rancherDocker & rancher
Docker & rancherAlin Voinea
 
Sencha touchonbb10 bootcamp
Sencha touchonbb10 bootcampSencha touchonbb10 bootcamp
Sencha touchonbb10 bootcampn_adam_stanley
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Dockerkanedafromparis
 
BlackBerry 10 Core Native Camera API
BlackBerry 10 Core Native Camera APIBlackBerry 10 Core Native Camera API
BlackBerry 10 Core Native Camera APISteven Beeckman
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windowsDocker, Inc.
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Ben Hall
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slidesDocker, Inc.
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to DockerJian Wu
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby DevelopersAptible
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf Conference
 
Fn project quick installation guide
Fn project quick installation guideFn project quick installation guide
Fn project quick installation guideJohan Louwers
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionBen Hall
 

Similar to Módulo de docker compose para ensino e aprendizagem do yml para docker (20)

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)
 
Building and Customizing CoreOS
Building and Customizing CoreOSBuilding and Customizing CoreOS
Building and Customizing CoreOS
 
Oracle obiee-11-installation-guide 11.1.1.6.0
Oracle obiee-11-installation-guide 11.1.1.6.0Oracle obiee-11-installation-guide 11.1.1.6.0
Oracle obiee-11-installation-guide 11.1.1.6.0
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peek
 
Developer-Friendly CI / CD for Kubernetes
Developer-Friendly CI / CD for KubernetesDeveloper-Friendly CI / CD for Kubernetes
Developer-Friendly CI / CD for Kubernetes
 
猿でもわかるコンテナ・オーケストレーション
猿でもわかるコンテナ・オーケストレーション猿でもわかるコンテナ・オーケストレーション
猿でもわかるコンテナ・オーケストレーション
 
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
 
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the CloudPHP on Heroku: Deploying and Scaling Apps in the Cloud
PHP on Heroku: Deploying and Scaling Apps in the Cloud
 
Docker & rancher
Docker & rancherDocker & rancher
Docker & rancher
 
Sencha touchonbb10 bootcamp
Sencha touchonbb10 bootcampSencha touchonbb10 bootcamp
Sencha touchonbb10 bootcamp
 
BBL Premiers pas avec Docker
BBL Premiers pas avec DockerBBL Premiers pas avec Docker
BBL Premiers pas avec Docker
 
BlackBerry 10 Core Native Camera API
BlackBerry 10 Core Native Camera APIBlackBerry 10 Core Native Camera API
BlackBerry 10 Core Native Camera API
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to Docker
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby Developers
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
 
Fn project quick installation guide
Fn project quick installation guideFn project quick installation guide
Fn project quick installation guide
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 

More from Diogo Soares Moreira

More from Diogo Soares Moreira (6)

Arquitetura_de_software_e_como_descreve-la_v2
Arquitetura_de_software_e_como_descreve-la_v2Arquitetura_de_software_e_como_descreve-la_v2
Arquitetura_de_software_e_como_descreve-la_v2
 
Introdução ao Android
Introdução ao AndroidIntrodução ao Android
Introdução ao Android
 
Bases de pesquisa acadêmica
Bases de pesquisa acadêmicaBases de pesquisa acadêmica
Bases de pesquisa acadêmica
 
Gt4 gerência de portfólio
Gt4   gerência de portfólioGt4   gerência de portfólio
Gt4 gerência de portfólio
 
Gerencia de-portfolio
Gerencia de-portfolioGerencia de-portfolio
Gerencia de-portfolio
 
Gerencia de-portfolio
Gerencia de-portfolioGerencia de-portfolio
Gerencia de-portfolio
 

Recently uploaded

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Recently uploaded (20)

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

Módulo de docker compose para ensino e aprendizagem do yml para docker

  • 1. Module 10: Docker Compose Docker Workshop © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
  • 2. Agenda What is docker compose? Features Installation YML File for docker compose Commands Lab 10: Simple Docker Compose Dive into the YML File Lab 11: Docker Compose © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
  • 3. What is docker compose? Define a multi-container application in a single file Spin your application up in a single command Docker Compose is a tool for defining and running complex applications with Docker. © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj
  • 4. Features Preserve volume data when containers are created Only recreate containers that have changed Multiple isolated environments on a single host © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj Variables and moving a composition between environments Multiple compose files
  • 5. Installation Linux: Windows / Mac - Docker Compose is included  © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker- compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose docker-compose --version Test the installation
  • 6. Before Docker Compose © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj $ docker run -d -it --name redis redis $ docker run -d -it --name postgres linhmtran168/postgres $ docker run -d -it --name web -v ~/Dev/gitlab.com/linhmtran168/test-project:/var/www/html --link postgres:db --link redis:redis linhmtran168/php-web $ docker run -d -it -p 80:80 --name nginx --link web:web --volumes- from web linhmtran168/php-nginx $ docker run -d -it --name node --link web:web --volumes-from web linhmtran168/gulp-bower
  • 7. After Docker Compose © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj web: build: . links: - redis:redis - postgres:db volumes: - .:/var/www/html nginx: build: ../docker-php-nginx ports: - "80:80" links: - web:web volumes_from: - web
  • 8. YML File © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj Networks Volumes Services Build Image Environment Ports Volumes Version
  • 9. Simple YML File © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj version: '3' services: jenkins: image: jenkins/jenkins:lts ports: - “8080:8080” - “50000:50000” artifactory: image: docker.bintray.io/jfrog/artifactory-oss:latest ports: - 8081:8081
  • 10. Commands © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj Sets the number of containers: List all the containers belong to the compose environment instance: Create and start all the containers listed in the “docker-compose.yml” $ docker-compose up -d $ docker-compose scale web=3 $ docker-compose ps
  • 11. Commands © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj build Build or rebuild services help Get help on a command kill Kill containers logs View output from containers port Print the public port for a port binding ps List containers pull Pulls service images rm Remove stopped containers run Run a one-off command scale Set number of containers for a service start Start services stop Stop services restart Restart services up Create and start containers
  • 12. Demo Docker Compose © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | DevOps Course | Leon Jalfon – leonj@sela.co.il
  • 13. Lab Lab 10: Simple Docker Compose © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj https://gitlab.com/docker-workshop/Lab-11
  • 14. Dive into the YML File © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj image: jenkins/jenkins:lts build: ./dir Image / Build version: '3' services: jenkins: image: jenkins/jenkins:lts ports: - “8080:8080” - “50000:50000” myapp: build: ./dir
  • 15. Dive into the YML File © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj web: build: . depends_on: - db - redis Depends_on version: '3' services: web: build: . depends_on: - db - redis
  • 16. Dive into the YML File © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj restart: "no" restart: always restart: on-failure restart: unless-stopped Restart version: '3' services: jenkins: image: jenkins/jenkins:lts ports: - “8080:8080” - “50000:50000” restart: alwayes
  • 17. Dive into the YML File © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress Environment Environment File env_file: .env version: '3' services: jenkins: image: jenkins/jenkins:lts ports: - “8080:8080” - “50000:50000” restart: always environment: MYSQL_USER: wordpress env_file: .env
  • 18. Dive into the YML File © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj web: networks: - sela Networks networks: sela: other: version: '3' services: jenkins: image: jenkins/jenkins:lts ports: - “8080:8080” - “50000:50000” restart: always environment: MYSQL_USER: wordpress networks: - sela networks: sela: other:
  • 19. Dive into the YML File © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj volumes: - "dbdata:/var/lib/postgresql/data" Volumes volumes : dbdata: version: '3' services: jenkins: image: jenkins/jenkins:lts ports: - “8080:8080” - “50000:50000” restart: always environment: MYSQL_USER: wordpress networks: - sela volumes: - dbdata:/var/lib/postgresql/data networks: sela: other: Volumes: dbdata:
  • 20. Demo Docker Compose © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | DevOps Course | Leon Jalfon – leonj@sela.co.il
  • 21. Lab Lab 11: Docker Compose © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj https://gitlab.com/docker-workshop/Lab-12
  • 22. Questions © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com | Leon Jalfon - Blog: http://blogs.microsoft.co.il/leonj