Docker.io for Developers

What are these crazy containers you speak of?

Who am I?

Dennis Reams
Crusty Ole Developer
  • I'm learning Docker, just like the rest of the world.
  • Showing you why Docker interests me, a developer.
  • Interested in what you think and have learned about Docker too.
  • Bottom Line: Don't be afraid to contribute to this session, I need all the help I can get.

What am I doing up here?

Agenda

  • Basics of Docker
  • Docker Lifecycle
  • Docker In Action (Demo Time)
    • Dockerfile
    • Demo App
  • Reference Material

Basics of Docker

From Docker: Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. Consisting of Docker Engine, a portable, lightweight runtime and packaging tool, and Docker Hub, a cloud service for sharing applications and automating workflows

From Wikipedi: Docker uses resource isolation features of the Linux kernel such as cgroups and kernel namespaces to allow independent "containers" to run within a single Linux instance, avoiding the overhead of starting virtual machines

From Me: One BIG A$$ closure.

Definition of Terms

  • Virtual Machine (VM) 
    • emulation of a computer system
    • full OS must be installed on each instance 
  • Image (aka Virtual Machine Image)
    • file consisting of a pre-configured OS and a single application.
  • Container (aka LinuX Container(LXC))
    • OS level virtualization for running multiple isolated Linux systems from a single host

Layman's terms please...

  • Docker Engine
    • A container hosting service that allows one to many containerized apps to run on a single OS by leveraging LXC
  • Docker Hub
    • Cloud based virtual image repository
    • Think maven repo or cdn.js for virtual machines
    • Access to official/supported images as well as crowdsourced contributions.

Container Lifecycle

  • Pull container image (from Docker Hub)
  • Build a container image
  • Run a container image
  • Start/Stop a container image
  • Push container image (to Docker Hub)
  • Remove a container/image

Docker Essentials

  • docker ps
    • list any running containers
  • docker ps -a
    • list any containers
  • docker logs -f {ur container id here}
    • display STDOUT & STDERR for a container
  • docker rm {ur container id here}
    • remove a stopped container
  • docker rmi {ur image tag id}
    • remove old images from your local machine

Docker Parameters

  • docker -i
    • interactive mode - comm via command line
  • docker -d
    • detached mode - comm via network connection.
  • docker -v
    • set data volumes in the container
  • docker --volume-from {container name}
    • allows hosting data volumes on another container.
  • docker --link {container name}
    • establishes communication between two containers.

Stop... Demo Time

  • DockerFile
    • Coding my environment set up
  • Demo Application
    • Swapping Datasources
    • Resetting Stateful Data

What's Next?

  • Continuous Integration
    • Automate this stuff!
  • Off loading work to other containers
  • Containers as Content Management System
  •  
  • How do you scale all this?

Reference Materials

?

Contact Info:
Dennis Reams
Twitter: @dennis77pr

Slides @ slides.com

Code @ GitHub

dockerfordevelopers

By dennis77pr

dockerfordevelopers

  • 1,425