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

Introduction to Docker

Introduction to Docker

Introduction to docker with examples.

Presented to the STL Docker meetup.

Steven Borrelli

January 08, 2014
Tweet

More Decks by Steven Borrelli

Other Decks in Technology

Transcript

  1. INTRODUCTION TO DOCKER
    ST. LOUIS DOCKER MEETUP
    !
    JANUARY 8, 2013
    Steven Borrelli
    [email protected]
    @stevendborrelli {github, twitter}

    View full-size slide

  2. STL Machine Learning
    !
    !
    Anupam Basu: Visualizing
    Shakespeare
    !
    Wednesday, January 22, 2014
    Jeremy Kohler: Using GIS in
    Investigative Reporting
    Tuesday, February 18, 2014
    Jeff Heaton: Neural Networks
    Wednesday March 19, 2014

    View full-size slide

  3. DOCKER HISTORY
    A dotCloud (PAAS provider) project

    Initial commit January 18, 2013
    Docker 0.1.0 released March 25, 2013


    8,800+ github stars, 1,200+ forks

    View full-size slide

  4. WHAT IS DOCKER?
    !
    “Docker is an open-source project to easily create
    lightweight,
    portable,
    self-sufficient
    containers
    from any application.”

    View full-size slide

  5. LIGHTWEIGHT
    !
    Based on Linux containers
    Minimal overhead (cpu/io/network)
    Uses layered filesystem to save space (AUFS/LVM)
    Uses a copy-on-write filesystem to track changes

    View full-size slide

  6. PORTABLE
    A Docker container will run on any Linux system that
    supports LXC.
    Raspberry pi support.
    Future plans to support other container tools 

    (lmctfy, etc.)
    Possible future support for other operating systems
    (Solaris, OSX, Windows?)

    View full-size slide

  7. SELF-SUFFICIENT
    A Docker container contains everything it needs to run:
    !
    Minimal Base OS
    Libraries and frameworks
    Application code
    !
    A docker container should be able to run anywhere that
    Docker can run.

    View full-size slide

  8. LINUX KERNEL
    LAYER FS
    CGROUPS NAMESPACES
    LXC
    DOCKER
    DOCKER ARCHITECTURE

    View full-size slide

  9. HISTORY OF VIRTUALIZATION
    IBM 360 (1968)

    View full-size slide

  10. VIRTUALIZATION
    http://www.vmware.com/virtualization/virtualization-basics/how-virtualization-works.html

    View full-size slide

  11. HARDWARE VIRTUALIZATION
    1966-1972 IBM CP/CMS
    1989 Insignia SoftPC
    1997 Connectix VirtualPC
    1999 VMWare Workstation
    2001 IBM AIX LPAR
    2002 Xen
    2006 Amazon EC2
    2007 Sun Logical Domains
    2007 Linux KVM
    2007 InnoTek VirtualBox
    2008 Microsoft Hyper-V

    View full-size slide

  12. Glauber Costa/LinuxCon 2012
    “I once heard that hypervisors are the living
    proof of operating system's incompetence.”

    View full-size slide

  13. CONTAINERS
    http://www.docker.io/the_whole_story/

    View full-size slide

  14. PROCESS VIRTUALIZATION
    1979-1982 UNIX Chroot
    1998 FreeBSD Jail
    2001 Parallels Virtuozzo
    2001 Linux-VServer
    2005 Solaris Zones
    2005 OpenVZ
    2008 Linux LXC
    2007+
    PAAS:
    Heroku, Joyent, CloudFoundry
    2013 Docker

    View full-size slide

  15. RUNNING DOCKER

    View full-size slide

  16. PULLING AN IMAGE

    View full-size slide

  17. STARTING A CONTAINER
    Mapping host volumes to a container

    View full-size slide

  18. MAPPING PORTS
    Example: run Zookeeper + Exhibitor
    Host ports will be dynamically allocated by docker
    Port 2181 on host will be mapped to 2181 on container

    View full-size slide

  19. LXC UNDER THE HOOD

    View full-size slide

  20. COMMITTING CHANGES
    Commit changes to a new image
    Run the new container
    Make changes to a running container

    View full-size slide

  21. EXAMPLE: INSTALL NODE.JS

    View full-size slide

  22. IMAGES ARE A GRAPH

    View full-size slide

  23. IMMUTABLE SERVERS
    Physical server lifetime is measured in
    years.
    A container's lifetime can only be a few
    seconds.
    Treat containers like a build artifact.
    If you need to make changes, build a new
    container.

    View full-size slide

  24. DOCKERFILES
    AUTOMATING BUILDS

    View full-size slide

  25. DOCKERFILES
    AUTOMATING BUILDS

    View full-size slide

  26. BUILDING AND RUNNING
    Build node container and and app container
    Run your app, and get the port:
    https://github.com/stevendborrelli/docker-meetup

    View full-size slide

  27. BUILDING AND RUNNING
    Stop/Start your container

    View full-size slide

  28. SUMMARY
    Easy to build, run & share containers
    Rapidly expanding ecosystem
    Better performance vs. VMs
    Layered filesystem gives us git-like control of images.
    Reduces complexity of system builds

    View full-size slide

  29. THE FUTURE IS EXCITING
    Lean base operating systems optimized for containers

    View full-size slide

  30. THE FUTURE IS EXCITING
    New operational models:
    Automated routing
    Distributed consensus (Paxos, Raft)
    Service Discovery
    Software Defined Networking
    Distributed scheduling (Mesos)

    View full-size slide