Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
PHPBenelux Wednesday, October 22, 2014
** VVaaggrraanntt iiss aa MMaannaaggeerr ffoorr VVMMss 
** VVaaggrraanntt iiss AAWWEESSOOMMEE!! 
** VVaaggrraanntt SSiimmp...
● ** sseerrvveerr vviirrttuuaalliizzaattiioonn iiss ssllooww 
● ** hhaarrdd ttoo ddiissttrriibbuuttee ((ccoommppaarreedd t...
● ** ddiisskk ssppaaccee hhoogg 
● ** sseerrvviiccee iinnssttaallll // rreemmoovvee ttrriiaallss aarree 
eexxppeennssiivve...
IItt aaiinn''tt aallll bbaadd!! 
** EExxcceelllleenntt ffoorr mmaannuuaall tteessttiinngg 
** EExxcceelllleenntt ffoorr SS...
RRuunnnniinngg oorr 
ddeevveellooppiinngg 
aa LLiinnuuxx 
aapppplliiccaattiioonn
PPuurrrriinngg pp oowweerr!!!!!!
"Docker iiss aann ooppeenn ppllaattffoorrmm ffoorr ddeevveellooppeerrss 
aanndd ssyyssaaddmmiinnss ttoo bbuuiilldd,, sshhi...
* dedicated tool to help build ssttaabbllee aapppplliiccaattiioonn 
eennvviirroonnmmeennttss 
** ddiissttrriibbuuttee tthh...
> whoami_ 
* built on top of LLXXCC ((ccoonnttaaiinneerr tteecchhnnoollooggyy)).. 
** uusseess ffiillee ssyysstteemm,, sst...
> ls effect_ 
** mmoorree eeffffiicciieenntt iinn rreessoouurrccee tteerrmmss 
** lleeaavvee bbeehhiinndd 9999..99%% VVMM ...
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@nickbel...
Actually we Need multiple Dockerfiles 
1 FOR APACHE (+ PHP) 
1 FOR a DB 
1 PER Application 
1 FOR NODE 
1 FOR VARNISH 
1 F...
Forge together 
Using 
Containers 
docker run -d -P --name postgres nickbelhomme/postgres 
docker run -d --link postgres:p...
> docker ps 
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 
e39 node:latest "grunt watch" 5 days ago Up 2 seconds ...
> docker run --rm --link postgres:postgres nickbelhomme/postgres env 
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/b...
> docker logs –follow applicationFoo-grunt 
Done, without errors. 
Completed in 0.438s at Wed Oct 15 2014 19:06:28 GMT+000...
> docker start postgres applicationFoo applicationFoo-grunt 
> docker stop postgres applicationFoo applicationFoo-grunt 
#...
Team distribution
> docker login 
> docker push nickbelhomme/postgres 
> docker pull nickbelhomme/postgres 
> docker run [options] [containe...
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 rm $(docker ps -a -q) 
> docker rmi $(docker images -a -q) 
> docker rmi $(docker images -q --filter "dangling=tr...
Change the default Docker network address 
> cat /etc/default/docker 
# Docker Upstart and SysVinit configuration file 
# ...
*Mounting volumes absolute FROM GUEST 
docker run -v /c/Users:containerPath 
* hosts file need to be set with 192.168.59.1...
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
Vagrant move over, here is Docker
Vagrant move over, here is Docker
Vagrant move over, here is Docker
Vagrant move over, here is Docker
Vagrant move over, here is Docker
Vagrant move over, here is Docker
Vagrant move over, here is Docker
Vagrant move over, here is Docker
Upcoming SlideShare
Loading in …5
×

of

Vagrant move over, here is Docker Slide 1 Vagrant move over, here is Docker Slide 2 Vagrant move over, here is Docker Slide 3 Vagrant move over, here is Docker Slide 4 Vagrant move over, here is Docker Slide 5 Vagrant move over, here is Docker Slide 6 Vagrant move over, here is Docker Slide 7 Vagrant move over, here is Docker Slide 8 Vagrant move over, here is Docker Slide 9 Vagrant move over, here is Docker Slide 10 Vagrant move over, here is Docker Slide 11 Vagrant move over, here is Docker Slide 12 Vagrant move over, here is Docker Slide 13 Vagrant move over, here is Docker Slide 14 Vagrant move over, here is Docker Slide 15 Vagrant move over, here is Docker Slide 16 Vagrant move over, here is Docker Slide 17 Vagrant move over, here is Docker Slide 18 Vagrant move over, here is Docker Slide 19 Vagrant move over, here is Docker Slide 20 Vagrant move over, here is Docker Slide 21 Vagrant move over, here is Docker Slide 22 Vagrant move over, here is Docker Slide 23 Vagrant move over, here is Docker Slide 24 Vagrant move over, here is Docker Slide 25 Vagrant move over, here is Docker Slide 26 Vagrant move over, here is Docker Slide 27 Vagrant move over, here is Docker Slide 28 Vagrant move over, here is Docker Slide 29 Vagrant move over, here is Docker Slide 30 Vagrant move over, here is Docker Slide 31 Vagrant move over, here is Docker Slide 32 Vagrant move over, here is Docker Slide 33 Vagrant move over, here is Docker Slide 34 Vagrant move over, here is Docker Slide 35 Vagrant move over, here is Docker Slide 36 Vagrant move over, here is Docker Slide 37
Upcoming SlideShare
Traits and Horizonal Design
Next
Download to read offline and view in fullscreen.

1 Like

Share

Download to read offline

Vagrant move over, here is Docker

Download to read offline

Developers need to be able to run an application on an environment as closely matched to production as possible. We can already do this through Vagrant.The problem with Vagrant is that it is slow and takes a lot of resources both in cpu and space. Docker doesn't have this problem and gives you a tool to create hundreds of different application environments on the same machine and distribute them through a registry. As Git replaced SVN, so has Docker replaced vagrant for application environment setups.Leave the future behind, own today (like a boss).

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Vagrant move over, here is Docker

  1. 1. PHPBenelux Wednesday, October 22, 2014
  2. 2. ** VVaaggrraanntt iiss aa MMaannaaggeerr ffoorr VVMMss ** VVaaggrraanntt iiss AAWWEESSOOMMEE!! ** VVaaggrraanntt SSiimmpplliiffiieedd oouurr lliivveess ttrreemmeennddoouussllyy
  3. 3. ● ** 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
  4. 4. ● ** ddiisskk ssppaaccee hhoogg ● ** sseerrvviiccee iinnssttaallll // rreemmoovvee ttrriiaallss aarree eexxppeennssiivvee ● ** ddeessttrrooyy ++ uupp iiss ccooffffeeee ttiimmee ● ** hhyyppeerrvviissoorr aabbssttrraaccttss aann eennttiirree ddeevviiccee ● ** eexxppeennssiivvee eemmuullaattiinngg vviirrttuuaall hhaarrddwwaarree
  5. 5. 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 ......
  6. 6. RRuunnnniinngg oorr ddeevveellooppiinngg aa LLiinnuuxx aapppplliiccaattiioonn
  7. 7. PPuurrrriinngg pp oowweerr!!!!!!
  8. 8. "Docker iiss aann ooppeenn ppllaattffoorrmm ffoorr ddeevveellooppeerrss aanndd ssyyssaaddmmiinnss ttoo bbuuiilldd,, sshhiipp,, aanndd rruunn ddiissttrriibbuutteedd aapppplliiccaattiioonnss..""
  9. 9. * dedicated tool to help build ssttaabbllee aapppplliiccaattiioonn eennvviirroonnmmeennttss ** ddiissttrriibbuuttee tthhoossee eennvviirroonnmmeennttss eeaassiillyy ** llooww ccoosstt iinnssttaallll // rreemmoovvee sseerrvviicceess
  10. 10. > whoami_ * built on top of LLXXCC ((ccoonnttaaiinneerr tteecchhnnoollooggyy)).. ** uusseess ffiillee ssyysstteemm,, ssttoorraaggee,, CCPPUU,, RRAAMM,, aanndd ssoo oonn ** jjuusstt aabbssttrraacctt tthhee ooppeerraattiinngg ssyysstteemm kkeerrnneell
  11. 11. > ls effect_ ** mmoorree eeffffiicciieenntt iinn rreessoouurrccee tteerrmmss ** lleeaavvee bbeehhiinndd 9999..99%% VVMM jjuunnkk ** 44-66 ttiimmeess mmoorree sseerrvveerr aapppplliiccaattiioonn iinnssttaanncceess
  12. 12. Terminology * Image * Container * Repository * Registry
  13. 13. We don't need no stinking
  14. 14. 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
  15. 15. 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
  16. 16. 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
  17. 17. > 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
  18. 18. > 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') ?>
  19. 19. > 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
  20. 20. > 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 ...
  21. 21. Team distribution
  22. 22. > docker login > docker push nickbelhomme/postgres > docker pull nickbelhomme/postgres > docker run [options] [container] > develop
  23. 23. Now some bad ass Super hero Tips
  24. 24. > 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
  25. 25. > docker rm $(docker ps -a -q) > docker rmi $(docker images -a -q) > docker rmi $(docker images -q --filter "dangling=true")
  26. 26. 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"
  27. 27. *Mounting volumes absolute FROM GUEST docker run -v /c/Users:containerPath * hosts file need to be set with 192.168.59.103
  28. 28. Lightweight Tiny Core Linux made for Docker containers. Runs completely from RAM, weighs ~27MB, boots in ~5s
  29. 29. Remember: Keep your docker Images single responsibility http://blog.nickbelhomme.com | https://joind.in/12295
  • fasoulas

    Nov. 16, 2014

Developers need to be able to run an application on an environment as closely matched to production as possible. We can already do this through Vagrant.The problem with Vagrant is that it is slow and takes a lot of resources both in cpu and space. Docker doesn't have this problem and gives you a tool to create hundreds of different application environments on the same machine and distribute them through a registry. As Git replaced SVN, so has Docker replaced vagrant for application environment setups.Leave the future behind, own today (like a boss).

Views

Total views

1,194

On Slideshare

0

From embeds

0

Number of embeds

26

Actions

Downloads

14

Shares

0

Comments

0

Likes

1

×