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

Cool Things About Docker

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.

Theo Pak

September 30, 2015
Tweet

More Decks by Theo Pak

Other Decks in Technology

Transcript

  1. Cool Things About Docker
    Theo Pak

    [email protected]

    twitter.com/theopak

    View Slide

  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

    View Slide

  3. Virtual Machines Containers
    Code that describes entire
    machines.
    Code that describes the
    application environment.

    View Slide

  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.

    View Slide

  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

    View Slide

  6. View Slide

  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.

    View Slide

  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'

    View Slide

  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

    View Slide

  10. Docker
    Build, Ship, Run

    View Slide