Cool Things About Docker

287abe4d8c0bf8eae92dd59b753f6323?s=47 Theo Pak
September 30, 2015

Cool Things About Docker

Theo Pak

Cimpress Infrastructure Core Engineering Lightning Talk: Wed Sept 30, 2015 @ 10:30am in Waltham, MA.

287abe4d8c0bf8eae92dd59b753f6323?s=128

Theo Pak

September 30, 2015
Tweet

Transcript

  1. 2.

    Linux Containers • A container is an isolated, 
 resource

    controlled, portable environment 
 for your application • Containers are lightweight • Microservices ❤ Containers • Linux containers prd ready on Docker 1.5 • Windows containers coming in 
 Windows Server 2016
  2. 4.

    Containers Containers are perfect for microservices - faster deployments -

    near zero startup penalty - highly automatable - resource, network, content isolation - dependency isolation Code that describes the application environment.
  3. 5.

    Build an Image Infrastructure as code: Containers are 
 your

    exact environment (but not a whole VM).
 $ git add Dockerfile
 $ git commit -m “Dev and Ops run the same Dockerfile” A Dockerfile defines a container image. 
 Images layer additively.
 $ cat Dockerfile
 FROM ubuntu
 RUN apt-get -y install ruby ruby-dev sensu
 COPY ./dist /var/my_app/
 EXPOSE 80
 CMD ["./start.sh"] Linux Containers are lightweight and perfect for microservices. 
 Virtually zero added cost to application startup/restart.
 $ docker build # build an image from the Dockerfile
 $ docker run # run an instance of an image
  4. 6.
  5. 7.

    Run an Image as a Container • No different DEV,

    CIT, PRD environments • Exactly one environment: the container • The same container runs on 
 your machine, Jenkins, AWS, etc • Expect your build to be identical on localhost, Jenkins, and prd. • Now, your source repo captures as much as possible about the application. • DevOps people are experts. Use their images as base.
  6. 8.

    puppet apply inside a container Use Puppet? Consul, Vagrant, Terraform?

    Auspice? You can get some of the benefits of containers in combination with complimentary tools. COPY puppet /etc/puppet
 RUN cd /etc/puppet \
 && librarian-puppet update
 RUN puppet apply /etc/puppet/manifests/default.pp \
 —-modulepath=‘/etc/puppet/modules' \
 --hiera_config='/etc/puppet/hiera.yaml'
  7. 9.

    Container-Oriented Design • Containers are isolated, resource-controlled, and portable •

    Containers are lightweight: you can run more containers than VMs on the same hardware • Containers are instances of Images. 
 Images are made of other Images. • You can get some of the benefits of containers in combination with a configuration managed by Puppet