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.
Docker and Puppet 
Containerization is the new virtualization
What's this all 
about?
What is Docker?
Container 
virtualization
Build, ship, run
Build once.
Run in many 
places.
Isolated, layered, 
standard and 
content agnostic
But this isn't 
new?!!?
So why should I care? 
Software delivery mechanism - a bit like a package! 
Put your application in a container, run it an...
Caring 
Containers boot faster 
Containers have less overhead 
Containers bring native performance 
Containers are Cloud &...
Docker Basics 
Image & Dockerfile 
The Docker Hub 
Container
Building Docker images 
FROM ubuntu 
MAINTAINER James Turnbull "james@example.com" 
RUN apt-get -qqy update 
RUN apt-get i...
Building the image 
$ sudo docker build -t="jamtur01/apache2" .
Sharing the image 
$ sudo docker push jamtur01/apache2
Running the container 
$ sudo docker run -ti -p 80:80 jamtur01/apache2
Docker and 
Puppet
So does the 
Dockerfile solve 
all?
Well sorta... 
It depends.
Doesn't have to deal with low-level stuff 
Doesn't have to converge 
Rebuilds are fast and cached 
Allows inheritance and ...
But...
Doesn't deal with low-level stuff 
Doesn't define resource dependencies 
Doesn't define what runs when
Dockerfile 
versus 
Shell script
Shell scripts 
Okay for simple stacks 
Imperative 
Rarely idempotent
Dockerfile 
versus 
Configuration 
Management
The Good 
Handles low-level stuff 
Abstracts details 
Ensures convergence to a known state 
Library of reusable, composabl...
The Bad 
Steep learning curve 
Generally requires a trigger 
Resource-intensive
Digging and fixing, 
Having so much fun 
Working together, 
They get the job done
Before 
Use Puppet to setup hardware, 
install packages, deploy code, run 
services. 
After 
Use Puppet to setup hardware,...
Install Docker 
with Puppet
Should I run 
Puppet in my 
containers?
Nope!
Should I use 
Puppet to build 
my images?
Yep!
Deploying a 
Puppet-powered 
container
Puppet Apply 
FROM ubuntu:14.04 
MAINTAINER James Turnbull "james@example.com" 
RUN apt-get -qqy update 
RUN apt-get -qqy ...
Librarian Puppet 
FROM ubuntu:14.04 
MAINTAINER James Turnbull "james@example.com" 
RUN apt-get -y -q install wget git-cor...
But there's more!
What if we could get rid of... 
SSHd - Access via nsenter or docker exec 
Crond in a container 
Logging in a container
Creates a new 
architecture
Separates orthogonal concerns 
Don't rebuild your app to change services 
Have different policies in domains 
Ship lighter...
Using Docker with Puppet - PuppetConf 2014
Using Docker with Puppet - PuppetConf 2014
Using Docker with Puppet - PuppetConf 2014
Using Docker with Puppet - PuppetConf 2014
Using Docker with Puppet - PuppetConf 2014
Using Docker with Puppet - PuppetConf 2014
Upcoming SlideShare
Loading in …5
×

Using Docker with Puppet - PuppetConf 2014

44,036 views

Published on

Using Docker with Puppet - James Turnbull, Kickstarter

Published in: Technology

Using Docker with Puppet - PuppetConf 2014

  1. 1. Docker and Puppet Containerization is the new virtualization
  2. 2. What's this all about?
  3. 3. What is Docker?
  4. 4. Container virtualization
  5. 5. Build, ship, run
  6. 6. Build once.
  7. 7. Run in many places.
  8. 8. Isolated, layered, standard and content agnostic
  9. 9. But this isn't new?!!?
  10. 10. So why should I care? Software delivery mechanism - a bit like a package! Put your application in a container, run it anywhere A bit like a VM but ...
  11. 11. Caring Containers boot faster Containers have less overhead Containers bring native performance Containers are Cloud & VM-compatible
  12. 12. Docker Basics Image & Dockerfile The Docker Hub Container
  13. 13. Building Docker images FROM ubuntu MAINTAINER James Turnbull "james@example.com" RUN apt-get -qqy update RUN apt-get install -qqy apache2 ADD index.html /var/www/ ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_LOG_DIR /var/log/apache2 EXPOSE 80 ENTRYPOINT ["/usr/sbin/apache2"] CMD ["-D", "FOREGROUND"]
  14. 14. Building the image $ sudo docker build -t="jamtur01/apache2" .
  15. 15. Sharing the image $ sudo docker push jamtur01/apache2
  16. 16. Running the container $ sudo docker run -ti -p 80:80 jamtur01/apache2
  17. 17. Docker and Puppet
  18. 18. So does the Dockerfile solve all?
  19. 19. Well sorta... It depends.
  20. 20. Doesn't have to deal with low-level stuff Doesn't have to converge Rebuilds are fast and cached Allows inheritance and composition Easy learning curve
  21. 21. But...
  22. 22. Doesn't deal with low-level stuff Doesn't define resource dependencies Doesn't define what runs when
  23. 23. Dockerfile versus Shell script
  24. 24. Shell scripts Okay for simple stacks Imperative Rarely idempotent
  25. 25. Dockerfile versus Configuration Management
  26. 26. The Good Handles low-level stuff Abstracts details Ensures convergence to a known state Library of reusable, composable templates
  27. 27. The Bad Steep learning curve Generally requires a trigger Resource-intensive
  28. 28. Digging and fixing, Having so much fun Working together, They get the job done
  29. 29. Before Use Puppet to setup hardware, install packages, deploy code, run services. After Use Puppet to setup hardware, install Docker, run containers. Use Dockerfiles to install packages, deploy code, run services.
  30. 30. Install Docker with Puppet
  31. 31. Should I run Puppet in my containers?
  32. 32. Nope!
  33. 33. Should I use Puppet to build my images?
  34. 34. Yep!
  35. 35. Deploying a Puppet-powered container
  36. 36. Puppet Apply FROM ubuntu:14.04 MAINTAINER James Turnbull "james@example.com" RUN apt-get -qqy update RUN apt-get -qqy install rubygems RUN gem install --no-ri --no-rdoc puppet RUN mkdir /puppet WORKDIR /puppet ADD site.pp /puppet/site.pp RUN puppet apply site.pp
  37. 37. Librarian Puppet FROM ubuntu:14.04 MAINTAINER James Turnbull "james@example.com" RUN apt-get -y -q install wget git-core rubygems RUN gem install --no-ri --no-rdoc puppet librarian-puppet ADD Puppetfile / RUN librarian-puppet install RUN puppet apply --modulepath=/modules -e "class { 'nginx': }" RUN echo "daemon off;" >> /etc/nginx/nginx.conf EXPOSE 80 CMD ["nginx"]
  38. 38. But there's more!
  39. 39. What if we could get rid of... SSHd - Access via nsenter or docker exec Crond in a container Logging in a container
  40. 40. Creates a new architecture
  41. 41. Separates orthogonal concerns Don't rebuild your app to change services Have different policies in domains Ship lighter apps

×