A Gentle Introduction to Docker

Carolyn Van Slyck

Whale saying hello

http://carolynvs.com/whale-hello

The Hype

🐳 🐳 🐳 🍄

Demystifying Docker

Classic Application Deployment

Virtual Application Deployment

Containerized Application Deployment

Linux Containers (LXC)

namespaces + cgroups = ISOLATION

Linux Namespaces

Isolation without virtualization

  • Process (pid): Can't see other processes
  • Filesystem (mnt): Can only see its own files
  • Networking (net): Gets its own network interface

Control Groups (cgroups)

Restrict resource usage: CPU, RAM, IO, Network

The Matrix is everywhere. It is all around us. Even now, in this very room. You can see it when you look out your window or when you turn on your television. You can feel it when you go to work... when you go to church... when you pay your taxes. It is the world that has been pulled over your eyes to blind you from the truth...

That you are a slave, Neo. Like everyone else you were born into bondage. Into a prison that you cannot taste or see or touch. A prison for your mind.

Morpheus in The Matrix

So what is Docker, anyway?

linux container + packaging + tools

Docker took something that previously was only an option for highly motivated sysadmins, and gave it away to the masses. Carolyn Van Slyck

Docker Image Packaging

Docker Tools


docker run --detach --volume `pwd`:/var/www --publish 80:80 nginx

What does this let us do?



Moves knowledge on how to run your app out of a readme and into code

 VMsDockerChef
Isolated
Repeatable
Sharable
Maintainable

The Catch

  • Filesystem is ephemeral, not persistent ➡ External file system
  • Images aren't enough ➡ Compose, Helm
  • Application Lifecycle Management ➡ Swarm, Kubernetes

How to get started

Define a Docker image

Dockerfile


FROM ubuntu:16.04
COPY bin/Linux/x86_64/magic /
CMD ["/magic"]

Build a Docker image


docker build -t carolynvs/magic .

Publish a Docker image


docker push carolynvs/magic

Run a Docker container


docker run --rm carolynvs/magic

Beginner Resources

Advanced Resources

Thank you

@carolynvs

http://carolynvs.com/whale-hello