SlideShare a Scribd company logo
1 of 37
Download to read offline
PHPBenelux Wednesday, October 22, 2014
** VVaaggrraanntt iiss aa MMaannaaggeerr ffoorr VVMMss 
** VVaaggrraanntt iiss AAWWEESSOOMMEE!! 
** VVaaggrraanntt SSiimmpplliiffiieedd oouurr lliivveess ttrreemmeennddoouussllyy
● ** sseerrvveerr vviirrttuuaalliizzaattiioonn iiss ssllooww 
● ** hhaarrdd ttoo ddiissttrriibbuuttee ((ccoommppaarreedd ttoo ddoocckkeerr)) 
● ** bbaassee bbooxx ++ vvaaggrraanntt pprroovviissiioonn ((ppuuppppeett,, aannssiibbllee,, 
ssaallttssttaacckk)) 
● ** vvaaggrraanntt ppaacckkaaggee ----bbaassee [[hhaasshh]] ----oouuttppuutt 
[[bbooxxnnaammee..bbooxx]] 
● ** ffiixxeedd mmeemmoorryy ccoonnssuummppttiioonn
● ** ddiisskk ssppaaccee hhoogg 
● ** sseerrvviiccee iinnssttaallll // rreemmoovvee ttrriiaallss aarree 
eexxppeennssiivvee 
● ** ddeessttrrooyy ++ uupp iiss ccooffffeeee ttiimmee 
● ** hhyyppeerrvviissoorr aabbssttrraaccttss aann eennttiirree ddeevviiccee 
● ** eexxppeennssiivvee eemmuullaattiinngg vviirrttuuaall hhaarrddwwaarree
IItt aaiinn''tt aallll bbaadd!! 
** EExxcceelllleenntt ffoorr mmaannuuaall tteessttiinngg 
** EExxcceelllleenntt ffoorr SSeelleenniiuumm GGrriidd 
** EExxcceelllleenntt ffoorr ttaakkiinngg aann OOSS tteesstt ddrriivvee 
** EExxcceelllleenntt ffoorr rruunnnniinngg nnoonn lliinnuuxx aappppss 
** AAnndd pprroobbaabbllyy aa lloott mmoorree!! 
BBuutt iitt aaiinn''tt ggoooodd ffoorr ......
RRuunnnniinngg oorr 
ddeevveellooppiinngg 
aa LLiinnuuxx 
aapppplliiccaattiioonn
PPuurrrriinngg pp oowweerr!!!!!!
"Docker iiss aann ooppeenn ppllaattffoorrmm ffoorr ddeevveellooppeerrss 
aanndd ssyyssaaddmmiinnss ttoo bbuuiilldd,, sshhiipp,, aanndd rruunn 
ddiissttrriibbuutteedd aapppplliiccaattiioonnss..""
* dedicated tool to help build ssttaabbllee aapppplliiccaattiioonn 
eennvviirroonnmmeennttss 
** ddiissttrriibbuuttee tthhoossee eennvviirroonnmmeennttss eeaassiillyy 
** llooww ccoosstt iinnssttaallll // rreemmoovvee sseerrvviicceess
> whoami_ 
* built on top of LLXXCC ((ccoonnttaaiinneerr tteecchhnnoollooggyy)).. 
** uusseess ffiillee ssyysstteemm,, ssttoorraaggee,, CCPPUU,, RRAAMM,, aanndd ssoo oonn 
** jjuusstt aabbssttrraacctt tthhee ooppeerraattiinngg ssyysstteemm kkeerrnneell
> ls effect_ 
** mmoorree eeffffiicciieenntt iinn rreessoouurrccee tteerrmmss 
** lleeaavvee bbeehhiinndd 9999..99%% VVMM jjuunnkk 
** 44-66 ttiimmeess mmoorree sseerrvveerr aapppplliiccaattiioonn iinnssttaanncceess
Terminology 
* Image 
* Container 
* Repository 
* Registry
We don't need no stinking
We Need a Dockerfile 
nickbelhomme/apache nickbelhomme/foo 
FROM debian:wheezy 
MAINTAINER Nick Belhomme, 
contact@nickbelhomme.com 
RUN apt-get update 
RUN apt-get install -y apache2 wget 
vim curl 
# expose the ports 
EXPOSE 80 
FROM nickbelhomme/apache 
RUN a2enmod rewrite 
RUN apt-get install -y php5-common 
libapache2-mod-php5 php5-cli php5- 
intl php5-curl php5-pgsql 
ADD dev/apache/application.conf 
/etc/apache2/sites-available/ 
application.conf 
RUN a2ensite application.conf
Actually we Need multiple Dockerfiles 
1 FOR APACHE (+ PHP) 
1 FOR a DB 
1 PER Application 
1 FOR NODE 
1 FOR VARNISH 
1 FOR MEMCACHED 
1 FOR REDIS 
1 FOR ... 
Or use the Registry for pre-build images
Forge together 
Using 
Containers 
docker run -d -P --name postgres nickbelhomme/postgres 
docker run -d --link postgres:postgres --name applicationFoo -v 
/home/nick/vhosts/foo/application:/var/www/vhosts/local.foo.com -p 49101:80 
nickbelhomme/foo /usr/sbin/apachectl -D FOREGROUND
> docker ps 
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 
e39 node:latest "grunt watch" 5 days ago Up 2 seconds applicationFoo-grunt 
a2d applicationFoo:latest "apachectl 2 weeks ago Up 2 seconds 49101->80/tcp applicationFoo 
bda postgres:latest "/usr/lib/postgresql 4 weeks ago Up 3 seconds 49155->5432/tcp 
fooBar/postgres,applicationFoo/postgres,gooBar/postgres,postgres 
http://local.foo.com:49101 
/etc/hosts => Docker0-ip local.foo.com
> docker run --rm --link postgres:postgres nickbelhomme/postgres env 
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 
HOSTNAME=0bda3edb485e 
POSTGRES_PORT=tcp://10.66.33.13:5432 
POSTGRES_PORT_5432_TCP=tcp://10.66.33.13:5432 
POSTGRES_PORT_5432_TCP_ADDR=10.66.33.13 
POSTGRES_PORT_5432_TCP_PORT=5432 
POSTGRES_PORT_5432_TCP_PROTO=tcp 
POSTGRES_NAME=/loving_colden/postgres 
HOME=/var/lib/postgresql 
<?php host=' . getenv('POSTGRES_PORT_5432_TCP_ADDR') ?>
> docker logs –follow applicationFoo-grunt 
Done, without errors. 
Completed in 0.438s at Wed Oct 15 2014 19:06:28 GMT+0000 (UTC) - Waiting... 
OK 
>> File "rawJs/foo/form.js" changed. 
Running "concat:js" (concat) task 
File "./public/js/source.js" created. 
Done, without errors. 
Completed in 0.458s at Wed Oct 15 2014 19:11:34 GMT+0000 (UTC) - Waiting... 
Running "watch" task
> docker start postgres applicationFoo applicationFoo-grunt 
> docker stop postgres applicationFoo applicationFoo-grunt 
#!/bin/bash 
if [ "$1" = "start" ]; then 
docker start postgres applicationFoo applicationFoo-grunt 
exit 
fi 
if [ "$1" = "db" ]; then 
docker run --rm --link postgres:postgres nickbelhomme/postgres env 
exit 
fi 
if [ "$1" = "grunt" ]; then 
docker logs --follow applicationFoo-grunt 
exit 
fi 
> ./project start 
> ./project stop 
> ./project grunt 
> ./project ...
Team distribution
> docker login 
> docker push nickbelhomme/postgres 
> docker pull nickbelhomme/postgres 
> docker run [options] [container] 
> develop
Now some bad 
ass Super hero 
Tips
> docker build -t nickbelhomme/foo . 
> docker build –no-cache=true 
> docker run --name applicationFoo 
> docker run –rm ... 
> docker run -w /var/www/vhosts/local.foo.com 
> docker run -i -t nickbelhomme/foo /bin/bash 
> docker run -v hostDir:containerDir
> docker rm $(docker ps -a -q) 
> docker rmi $(docker images -a -q) 
> docker rmi $(docker images -q --filter "dangling=true")
Change the default Docker network address 
> cat /etc/default/docker 
# Docker Upstart and SysVinit configuration file 
# Customize location of Docker binary (especially for development testing). 
#DOCKER="/usr/local/bin/docker" 
# Use DOCKER_OPTS to modify the daemon startup options. 
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" 
DOCKER_OPTS="—bip=10.66.33.10/24" 
# If you need Docker to use an HTTP proxy, it can also be specified here. 
#export http_proxy="http://127.0.0.1:3128/" 
# This is also a handy place to tweak where Docker's temporary files go. 
#export TMPDIR="/mnt/bigdrive/docker-tmp"
*Mounting volumes absolute FROM GUEST 
docker run -v /c/Users:containerPath 
* hosts file need to be set with 192.168.59.103
Lightweight Tiny Core Linux made for Docker containers. 
Runs completely from RAM, weighs ~27MB, boots in ~5s
Remember: 
Keep your docker 
Images single 
responsibility 
http://blog.nickbelhomme.com | https://joind.in/12295

More Related Content

What's hot

Dependency Management with Composer
Dependency Management with ComposerDependency Management with Composer
Dependency Management with ComposerJordi Boggiano
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90minsLarry Cai
 
Composer - Package Management for PHP. Silver Bullet?
Composer - Package Management for PHP. Silver Bullet?Composer - Package Management for PHP. Silver Bullet?
Composer - Package Management for PHP. Silver Bullet?Kirill Chebunin
 
DevOps in PHP environment
DevOps in PHP environment DevOps in PHP environment
DevOps in PHP environment Evaldo Felipe
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with ComposerJason Grimes
 
Gearman work queue in php
Gearman work queue in phpGearman work queue in php
Gearman work queue in phpBo-Yi Wu
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Clark Everetts
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitFighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitJames Fuller
 
Phing: Building with PHP
Phing: Building with PHPPhing: Building with PHP
Phing: Building with PHPhozn
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with PhingMichiel Rook
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with DockerPatrick Mizer
 
Automated Deployment With Phing
Automated Deployment With PhingAutomated Deployment With Phing
Automated Deployment With PhingDaniel Cousineau
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterZendCon
 
Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginnersAdam Englander
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flaskjuzten
 

What's hot (20)

Dependency Management with Composer
Dependency Management with ComposerDependency Management with Composer
Dependency Management with Composer
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 
Composer - Package Management for PHP. Silver Bullet?
Composer - Package Management for PHP. Silver Bullet?Composer - Package Management for PHP. Silver Bullet?
Composer - Package Management for PHP. Silver Bullet?
 
DevOps in PHP environment
DevOps in PHP environment DevOps in PHP environment
DevOps in PHP environment
 
C++ for the Web
C++ for the WebC++ for the Web
C++ for the Web
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
 
Gearman work queue in php
Gearman work queue in phpGearman work queue in php
Gearman work queue in php
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016
 
Fighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnitFighting Fear-Driven-Development With PHPUnit
Fighting Fear-Driven-Development With PHPUnit
 
Maven 3.0 at Øredev
Maven 3.0 at ØredevMaven 3.0 at Øredev
Maven 3.0 at Øredev
 
Phing: Building with PHP
Phing: Building with PHPPhing: Building with PHP
Phing: Building with PHP
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with Phing
 
Continuous Quality Assurance
Continuous Quality AssuranceContinuous Quality Assurance
Continuous Quality Assurance
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with Docker
 
Automated Deployment With Phing
Automated Deployment With PhingAutomated Deployment With Phing
Automated Deployment With Phing
 
Phing
PhingPhing
Phing
 
Ant vs Phing
Ant vs PhingAnt vs Phing
Ant vs Phing
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life better
 
Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginners
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flask
 

Similar to Vagrant move over, here is Docker

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 Herokuronnywang_tw
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...Docker, Inc.
 
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...Christy Norman
 
Hands-On Session Docker
Hands-On Session DockerHands-On Session Docker
Hands-On Session DockerLinetsChile
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from githubAntony Gitomeh
 
Happy porting x86 application to android
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to androidOwen Hsu
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppetlutter
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014D
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerJustyna Ilczuk
 
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
 
OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의Juhong Jung
 
Docker command
Docker commandDocker command
Docker commandEric Ahn
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linuxtutorialsruby
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linuxtutorialsruby
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linuxtutorialsruby
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linuxtutorialsruby
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 

Similar to Vagrant move over, here is Docker (20)

PHP selber bauen
PHP selber bauenPHP selber bauen
PHP selber bauen
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Docker practice
Docker practiceDocker practice
Docker practice
 
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
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
 
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
 
Hands-On Session Docker
Hands-On Session DockerHands-On Session Docker
Hands-On Session Docker
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from github
 
Happy porting x86 application to android
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to android
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
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)
 
OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의
 
Docker command
Docker commandDocker command
Docker command
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 

Recently uploaded

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 

Recently uploaded (20)

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 

Vagrant move over, here is Docker

  • 1.
  • 3.
  • 4. ** VVaaggrraanntt iiss aa MMaannaaggeerr ffoorr VVMMss ** VVaaggrraanntt iiss AAWWEESSOOMMEE!! ** VVaaggrraanntt SSiimmpplliiffiieedd oouurr lliivveess ttrreemmeennddoouussllyy
  • 5.
  • 6. ● ** sseerrvveerr vviirrttuuaalliizzaattiioonn iiss ssllooww ● ** hhaarrdd ttoo ddiissttrriibbuuttee ((ccoommppaarreedd ttoo ddoocckkeerr)) ● ** bbaassee bbooxx ++ vvaaggrraanntt pprroovviissiioonn ((ppuuppppeett,, aannssiibbllee,, ssaallttssttaacckk)) ● ** vvaaggrraanntt ppaacckkaaggee ----bbaassee [[hhaasshh]] ----oouuttppuutt [[bbooxxnnaammee..bbooxx]] ● ** ffiixxeedd mmeemmoorryy ccoonnssuummppttiioonn
  • 7. ● ** ddiisskk ssppaaccee hhoogg ● ** sseerrvviiccee iinnssttaallll // rreemmoovvee ttrriiaallss aarree eexxppeennssiivvee ● ** ddeessttrrooyy ++ uupp iiss ccooffffeeee ttiimmee ● ** hhyyppeerrvviissoorr aabbssttrraaccttss aann eennttiirree ddeevviiccee ● ** eexxppeennssiivvee eemmuullaattiinngg vviirrttuuaall hhaarrddwwaarree
  • 8. IItt aaiinn''tt aallll bbaadd!! ** EExxcceelllleenntt ffoorr mmaannuuaall tteessttiinngg ** EExxcceelllleenntt ffoorr SSeelleenniiuumm GGrriidd ** EExxcceelllleenntt ffoorr ttaakkiinngg aann OOSS tteesstt ddrriivvee ** EExxcceelllleenntt ffoorr rruunnnniinngg nnoonn lliinnuuxx aappppss ** AAnndd pprroobbaabbllyy aa lloott mmoorree!! BBuutt iitt aaiinn''tt ggoooodd ffoorr ......
  • 9. RRuunnnniinngg oorr ddeevveellooppiinngg aa LLiinnuuxx aapppplliiccaattiioonn
  • 11. "Docker iiss aann ooppeenn ppllaattffoorrmm ffoorr ddeevveellooppeerrss aanndd ssyyssaaddmmiinnss ttoo bbuuiilldd,, sshhiipp,, aanndd rruunn ddiissttrriibbuutteedd aapppplliiccaattiioonnss..""
  • 12. * dedicated tool to help build ssttaabbllee aapppplliiccaattiioonn eennvviirroonnmmeennttss ** ddiissttrriibbuuttee tthhoossee eennvviirroonnmmeennttss eeaassiillyy ** llooww ccoosstt iinnssttaallll // rreemmoovvee sseerrvviicceess
  • 13. > whoami_ * built on top of LLXXCC ((ccoonnttaaiinneerr tteecchhnnoollooggyy)).. ** uusseess ffiillee ssyysstteemm,, ssttoorraaggee,, CCPPUU,, RRAAMM,, aanndd ssoo oonn ** jjuusstt aabbssttrraacctt tthhee ooppeerraattiinngg ssyysstteemm kkeerrnneell
  • 14. > ls effect_ ** mmoorree eeffffiicciieenntt iinn rreessoouurrccee tteerrmmss ** lleeaavvee bbeehhiinndd 9999..99%% VVMM jjuunnkk ** 44-66 ttiimmeess mmoorree sseerrvveerr aapppplliiccaattiioonn iinnssttaanncceess
  • 15. Terminology * Image * Container * Repository * Registry
  • 16.
  • 17.
  • 18. We don't need no stinking
  • 19. We Need a Dockerfile nickbelhomme/apache nickbelhomme/foo FROM debian:wheezy MAINTAINER Nick Belhomme, contact@nickbelhomme.com RUN apt-get update RUN apt-get install -y apache2 wget vim curl # expose the ports EXPOSE 80 FROM nickbelhomme/apache RUN a2enmod rewrite RUN apt-get install -y php5-common libapache2-mod-php5 php5-cli php5- intl php5-curl php5-pgsql ADD dev/apache/application.conf /etc/apache2/sites-available/ application.conf RUN a2ensite application.conf
  • 20.
  • 21. Actually we Need multiple Dockerfiles 1 FOR APACHE (+ PHP) 1 FOR a DB 1 PER Application 1 FOR NODE 1 FOR VARNISH 1 FOR MEMCACHED 1 FOR REDIS 1 FOR ... Or use the Registry for pre-build images
  • 22. Forge together Using Containers docker run -d -P --name postgres nickbelhomme/postgres docker run -d --link postgres:postgres --name applicationFoo -v /home/nick/vhosts/foo/application:/var/www/vhosts/local.foo.com -p 49101:80 nickbelhomme/foo /usr/sbin/apachectl -D FOREGROUND
  • 23. > docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e39 node:latest "grunt watch" 5 days ago Up 2 seconds applicationFoo-grunt a2d applicationFoo:latest "apachectl 2 weeks ago Up 2 seconds 49101->80/tcp applicationFoo bda postgres:latest "/usr/lib/postgresql 4 weeks ago Up 3 seconds 49155->5432/tcp fooBar/postgres,applicationFoo/postgres,gooBar/postgres,postgres http://local.foo.com:49101 /etc/hosts => Docker0-ip local.foo.com
  • 24. > docker run --rm --link postgres:postgres nickbelhomme/postgres env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=0bda3edb485e POSTGRES_PORT=tcp://10.66.33.13:5432 POSTGRES_PORT_5432_TCP=tcp://10.66.33.13:5432 POSTGRES_PORT_5432_TCP_ADDR=10.66.33.13 POSTGRES_PORT_5432_TCP_PORT=5432 POSTGRES_PORT_5432_TCP_PROTO=tcp POSTGRES_NAME=/loving_colden/postgres HOME=/var/lib/postgresql <?php host=' . getenv('POSTGRES_PORT_5432_TCP_ADDR') ?>
  • 25. > docker logs –follow applicationFoo-grunt Done, without errors. Completed in 0.438s at Wed Oct 15 2014 19:06:28 GMT+0000 (UTC) - Waiting... OK >> File "rawJs/foo/form.js" changed. Running "concat:js" (concat) task File "./public/js/source.js" created. Done, without errors. Completed in 0.458s at Wed Oct 15 2014 19:11:34 GMT+0000 (UTC) - Waiting... Running "watch" task
  • 26. > docker start postgres applicationFoo applicationFoo-grunt > docker stop postgres applicationFoo applicationFoo-grunt #!/bin/bash if [ "$1" = "start" ]; then docker start postgres applicationFoo applicationFoo-grunt exit fi if [ "$1" = "db" ]; then docker run --rm --link postgres:postgres nickbelhomme/postgres env exit fi if [ "$1" = "grunt" ]; then docker logs --follow applicationFoo-grunt exit fi > ./project start > ./project stop > ./project grunt > ./project ...
  • 28. > docker login > docker push nickbelhomme/postgres > docker pull nickbelhomme/postgres > docker run [options] [container] > develop
  • 29. Now some bad ass Super hero Tips
  • 30. > docker build -t nickbelhomme/foo . > docker build –no-cache=true > docker run --name applicationFoo > docker run –rm ... > docker run -w /var/www/vhosts/local.foo.com > docker run -i -t nickbelhomme/foo /bin/bash > docker run -v hostDir:containerDir
  • 31. > docker rm $(docker ps -a -q) > docker rmi $(docker images -a -q) > docker rmi $(docker images -q --filter "dangling=true")
  • 32. Change the default Docker network address > cat /etc/default/docker # Docker Upstart and SysVinit configuration file # Customize location of Docker binary (especially for development testing). #DOCKER="/usr/local/bin/docker" # Use DOCKER_OPTS to modify the daemon startup options. #DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" DOCKER_OPTS="—bip=10.66.33.10/24" # If you need Docker to use an HTTP proxy, it can also be specified here. #export http_proxy="http://127.0.0.1:3128/" # This is also a handy place to tweak where Docker's temporary files go. #export TMPDIR="/mnt/bigdrive/docker-tmp"
  • 33.
  • 34.
  • 35. *Mounting volumes absolute FROM GUEST docker run -v /c/Users:containerPath * hosts file need to be set with 192.168.59.103
  • 36. Lightweight Tiny Core Linux made for Docker containers. Runs completely from RAM, weighs ~27MB, boots in ~5s
  • 37. Remember: Keep your docker Images single responsibility http://blog.nickbelhomme.com | https://joind.in/12295