SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Downloaden Sie, um offline zu lesen
PLAY WITH DOCKER
KARIM MEMON@abdulkarim_me
TABLE OF GYAAN
DOCKER
DOCKER COMPOSE
DOCKER MACHINE
PLAY-WITH-DOCKER.COM
RESOURCES
TABLE OF GYAAN
DOCKER
DOCKER COMPOSE
DOCKER MACHINE
PLAY-WITH-DOCKER.COM
RESOURCES
DOCKER: MIND MAP
DOCKER
DOCKER
BUILD
DOCKER
BUILD
SHIP
DOCKER
BUILD
SHIP
RUN
DOCKER
https://www.architectgroup.com/docs/docker/_images/info-6.png
DOCKER: BUILD
$ echo "<? phpinfo(); ?>" > index.php
Source Code
DockerïŹle
Building Docker Image
DOCKER: BUILD
FROM php:7.0-apache
COPY index.php /var/www/html/
$ echo "<? phpinfo(); ?>" > index.php
Source Code
DockerïŹle
Building Docker Image
DOCKER: BUILD
FROM php:7.0-apache
COPY index.php /var/www/html/
$ echo "<? phpinfo(); ?>" > index.php
$ docker build -t dobyexample/php-info-demo .
Source Code
DockerïŹle
Building Docker Image
DOCKER: SHIP
$ docker login --username=kn330
$ docker push dobyexample/php-info-demo
DOCKER: SHIP [HAVELI MODE]
DOCKER: SHIP [HAVELI MODE]
# EXPORT
DOCKER: SHIP [HAVELI MODE]
# EXPORT
$ docker save dobyexample/php-info-demo >
dobyexample-php-info-demo.tar
DOCKER: SHIP [HAVELI MODE]
# EXPORT
$ docker save dobyexample/php-info-demo >
dobyexample-php-info-demo.tar
# IMPORT
DOCKER: SHIP [HAVELI MODE]
# EXPORT
$ docker save dobyexample/php-info-demo >
dobyexample-php-info-demo.tar
# IMPORT
$ docker load < dobyexample-php-info-demo.tar
DOCKER: RUN
$ docker run -d -p 8080:80 --name phpinfo dobyexample/php-info-demo
DOCKER: TIP
$ docker run -d 
-v “/var/run/docker.sock:/var/run/docker.sock” 
-p 9000:9000 
portainer/portainer
TABLE OF GYAAN
DOCKER
DOCKER COMPOSE
DOCKER MACHINE
PLAY-WITH-DOCKER.COM
RESOURCES
DOCKER COMPOSE
DOCKER COMPOSE
DEFINING AND RUNNING MULTI-CONTAINER DOCKER
APPLICATIONS
DOCKER COMPOSE: MULTI CONTAINER
DOCKER COMPOSE: MULTI CONTAINER
$ docker pull redis
DOCKER COMPOSE: MULTI CONTAINER
$ docker pull redis
$ docker build -t web .
DOCKER COMPOSE: MULTI CONTAINER
$ docker pull redis
$ docker build -t web .
$ docker run -d —name=db redis
DOCKER COMPOSE: MULTI CONTAINER
$ docker pull redis
$ docker build -t web .
$ docker run -d —name=db redis
$ docker run -d --link db:db -p 3000:80 web python app.py
DOCKER COMPOSE: MULTI CONTAINER
$ docker pull redis
$ docker build -t web .
$ docker run -d —name=db redis
$ docker run -d --link db:db -p 3000:80 web python app.py
MULTI CONTAINER APPLICATIONS ARE BITTER
DOCKER COMPOSE: MULTI CONTAINER
$ docker pull redis
$ docker build -t web .
$ docker run -d —name=db redis
$ docker run -d --link db:db -p 3000:80 web python app.py
MULTI CONTAINER APPLICATIONS ARE BITTER
WE NEED SIMPLER WAY TO DEFINE AND MANAGE‹
MULTI CONTAINER APPLICATIONS
DOCKER COMPOSE: MULTI CONTAINER
DOCKER COMPOSE: YAML
DOCKER COMPOSE: YAML
$ docker pull mysql
$ docker pull wordpress
$ docker run -d --name=db‹
-e MYSQL_ROOT_PASSWORD=root‹
mysql
$ docker run --name=wp -p
8000:80 --link db:db -e
WORDPRESS_DB_HOST=db -e
WORDPRESS_DB_PASSWORD=root
wordpress
DOCKER COMPOSE: YAML
$ docker pull mysql
$ docker pull wordpress
$ docker run -d --name=db‹
-e MYSQL_ROOT_PASSWORD=root‹
mysql
$ docker run --name=wp -p
8000:80 --link db:db -e
WORDPRESS_DB_HOST=db -e
WORDPRESS_DB_PASSWORD=root
wordpress
version: '2'
services:
db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: root
wp:
depends_on:
- db
image: wordpress
ports:
- "8000:80"
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_PASSWORD: root
DOCKER COMPOSE: YAML
$ docker pull mysql
$ docker pull wordpress
$ docker run -d --name=db‹
-e MYSQL_ROOT_PASSWORD=root‹
mysql
$ docker run --name=wp -p
8000:80 --link db:db -e
WORDPRESS_DB_HOST=db -e
WORDPRESS_DB_PASSWORD=root
wordpress
version: '2'
services:
db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: root
wp:
depends_on:
- db
image: wordpress
ports:
- "8000:80"
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_PASSWORD: root
$ docker-compose up
DOCKER COMPOSE: YAML
$ docker pull mysql
$ docker pull wordpress
$ docker run -d --name=db‹
-e MYSQL_ROOT_PASSWORD=root‹
mysql
$ docker run --name=wp -p
8000:80 --link db:db -e
WORDPRESS_DB_HOST=db -e
WORDPRESS_DB_PASSWORD=root
wordpress
version: '2'
services:
db:
image: mysql
environment:
MYSQL_ROOT_PASSWORD: root
wp:
depends_on:
- db
image: wordpress
ports:
- "8000:80"
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_PASSWORD: root
$ docker-compose up
SO MUCH WIN!
TABLE OF GYAAN
DOCKER
DOCKER COMPOSE
DOCKER MACHINE
PLAY-WITH-DOCKER.COM
RESOURCES
DOCKER MACHINE
DOCKER MACHINE
MANGAE DOCKER HOSTS
DOCKER MACHINE
MANGAE DOCKER HOSTS
LOCAL
DOCKER MACHINE
MANGAE DOCKER HOSTS
LOCAL
STD
DOCKER MACHINE
MANGAE DOCKER HOSTS
LOCAL
ISD
STD
DOCKER MACHINE
$ docker-machine create -d digitalocean --digitalocean-access-token=xx staging
$ eval "$(docker-machine env staging)”
$ docker run -d -p 8080:80 --name phpinfo-app dobyexample/php-info-demo
TABLE OF GYAAN
DOCKER
DOCKER COMPOSE
DOCKER MACHINE
PLAY-WITH-DOCKER.COM
RESOURCES
PLAY-WITH-DOCKER
training.play-with-docker.com
QA
RESOURCES
https://docs.docker.com/get-started/#prerequisites
http://training.play-with-docker.com/helloworld/
https://docs.docker.com/compose/rails/
https://docs.docker.com/compose/django/
https://github.com/docker/labs/blob/master/windows/readme.md
https://github.com/docker/machine
https://dobyexample.gitbooks.io/docker-101-dobyexample/content/chapter-5/

Weitere Àhnliche Inhalte

Was ist angesagt?

2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
ronnywang_tw
 
Dealing with Continuous Data Processing, ConFoo 2012
Dealing with Continuous Data Processing, ConFoo 2012Dealing with Continuous Data Processing, ConFoo 2012
Dealing with Continuous Data Processing, ConFoo 2012
Michael Peacock
 
Ops for everyone - John Britton
Ops for everyone - John BrittonOps for everyone - John Britton
Ops for everyone - John Britton
Devopsdays
 
Generators
GeneratorsGenerators
Generators
Allan Davis
 

Was ist angesagt? (18)

Introduction to the Pods JSON API
Introduction to the Pods JSON APIIntroduction to the Pods JSON API
Introduction to the Pods JSON API
 
Undercover Pods / WP Functions
Undercover Pods / WP FunctionsUndercover Pods / WP Functions
Undercover Pods / WP Functions
 
Joomla! Day UK 2009 .htaccess
Joomla! Day UK 2009 .htaccessJoomla! Day UK 2009 .htaccess
Joomla! Day UK 2009 .htaccess
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn Flow
 
Manage WordPress with Awesome using wp cli
Manage WordPress with Awesome using wp cliManage WordPress with Awesome using wp cli
Manage WordPress with Awesome using wp cli
 
Traversing Search Results
Traversing Search ResultsTraversing Search Results
Traversing Search Results
 
Symfony: Your Next Microframework (SymfonyCon 2015)
Symfony: Your Next Microframework (SymfonyCon 2015)Symfony: Your Next Microframework (SymfonyCon 2015)
Symfony: Your Next Microframework (SymfonyCon 2015)
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
 
04 Architecting Navigation
04   Architecting Navigation04   Architecting Navigation
04 Architecting Navigation
 
Using the new WordPress REST API
Using the new WordPress REST APIUsing the new WordPress REST API
Using the new WordPress REST API
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
 
Installation and setup hadoop published
Installation and setup hadoop publishedInstallation and setup hadoop published
Installation and setup hadoop published
 
Dealing with Continuous Data Processing, ConFoo 2012
Dealing with Continuous Data Processing, ConFoo 2012Dealing with Continuous Data Processing, ConFoo 2012
Dealing with Continuous Data Processing, ConFoo 2012
 
Commands
CommandsCommands
Commands
 
HBase + Hue - LA HBase User Group
HBase + Hue - LA HBase User GroupHBase + Hue - LA HBase User Group
HBase + Hue - LA HBase User Group
 
Ops for everyone - John Britton
Ops for everyone - John BrittonOps for everyone - John Britton
Ops for everyone - John Britton
 
Container and microservices: a love story
Container and microservices: a love storyContainer and microservices: a love story
Container and microservices: a love story
 
Generators
GeneratorsGenerators
Generators
 

Ähnlich wie Play With Docker

Ähnlich wie Play With Docker (20)

Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014
 
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
 
Docker - introduction
Docker - introductionDocker - introduction
Docker - introduction
 
Docker orchestration v4
Docker orchestration v4Docker orchestration v4
Docker orchestration v4
 
Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
æĄƒćœ’ćž‚æ•™è‚Čć±€DockeræŠ€èĄ“ć…„é–€èˆ‡ćŻŠäœœ
æĄƒćœ’ćž‚æ•™è‚Čć±€DockeræŠ€èĄ“ć…„é–€èˆ‡ćŻŠäœœæĄƒćœ’ćž‚æ•™è‚Čć±€DockeræŠ€èĄ“ć…„é–€èˆ‡ćŻŠäœœ
æĄƒćœ’ćž‚æ•™è‚Čć±€DockeræŠ€èĄ“ć…„é–€èˆ‡ćŻŠäœœ
 
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
 
Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshop
 
Wordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccionWordpress y Docker, de desarrollo a produccion
Wordpress y Docker, de desarrollo a produccion
 
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)
 
Docker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google CloudDocker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google Cloud
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
Docker for Ruby Developers
Docker for Ruby DevelopersDocker for Ruby Developers
Docker for Ruby Developers
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
Into to Docker (Central PA Java User Group - 8/14/2017)
Into to Docker (Central PA Java User Group - 8/14/2017)Into to Docker (Central PA Java User Group - 8/14/2017)
Into to Docker (Central PA Java User Group - 8/14/2017)
 
Simple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE LabSimple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE Lab
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOps
 
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
 

KĂŒrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

KĂŒrzlich hochgeladen (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Play With Docker