Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automating Docker Containers with Puppet

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for Kylo Ginsberg Kylo Ginsberg
October 13, 2014
51

Automating Docker Containers with Puppet

Automating Docker Containers with Puppet, 2014-10-13.

Avatar for Kylo Ginsberg

Kylo Ginsberg

October 13, 2014
Tweet

Transcript

  1. So you can write: package { ‘ntp’:! ensure => installed,!

    }! file { ‘/etc/ntp.conf’:! ensure => file,! source => ‘/root/example/ntp.conf’,! mode => ‘0444’,! }! service { ‘ntp’:! ensure => running,! }
  2. Building: puppet apply FROM ubuntu:14.04 ! RUN apt-get -y update

    RUN apt-get -y install ruby RUN gem install puppet RUN puppet module install puppetlabs/ntp RUN puppet apply -e 'include "::ntp"'
  3. Building: puppet agent FROM ubuntu:14.04 ! RUN apt-get -y update

    RUN apt-get -y install ruby RUN gem install puppet RUN puppet agent -t —server my_host
  4. Building: puppet apply FROM jamtur01/puppetbase MAINTAINER James Turnbull "[email protected]" !

    RUN apt-get -y -q install wget git-core 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"]
  5. Running docker with puppet docker::run { 'helloworld': image => 'ubuntu:precise',

    command => '/bin/sh -c "while true; do echo hello world; sleep 1; done"', }
  6. Bye