INTRODUCTION TO DOCKER
Ranjan Baisak (RB)
rbaisak@juniper.net
CLOUD MARKET
Developer
s
Public
Develops
Architects
IT Pros
HybridPrivate
WHAT IS DOCKER
 An Open-Source (Go) framework to manage “container virtualization”
 Docker isolates multiple user spaces (file systems) inside the same
host
 The user space instances are called “Containers”
 They give you the illusion of being inside a VM
 Think about “execution environments” or “sandboxes”
 No need for an hypervisor (and so very quick to launch)
 Requires x64 Linux and kernel 3.8+
WHAT IS DOCKER
 An Open-Source (Go) framework to manage “container virtualization”
 Docker isolates multiple user spaces (file systems) inside the same host
 The user space instances are called “Containers”
 They give you the illusion of being inside a VM
 Think about “execution environments” or “sandboxes”
 No need for an hypervisor (and so very quick to launch)
 Requires x64 Linux and kernel 3.8+
VIRTUAL MACHINE VS DOCKER
Virtual Machines
Each virtual machine includes the application, the necessary
binaries and libraries and an entire guest operating system - all
of which may be tens of GBs in size.
Containers
Containers include the application and all of its dependencies, but share the
kernel with other containers. They run as an isolated process in userspace on
the host operating system. They’re also not tied to any specific infrastructure –
Docker containers run on any computer, on any infrastructure and in any
cloud.
DOCKER IS NOT
 A programming language
 An OS
 A Virtual Machine
 An image in the traditional hypervisor-based Virtual Machine concept
GLOSSARY
 Docker, aka Docker Engine: the daemon managing docker images and containers (using
namespaces and cgroups). It runs on the (Linux-based) Host.
 Docker client: the binary interacting with the Docker Engine.
 Docker Image: a filesystem (read-only template) used to create a Container (think “the binary”)
 Docker Container: a running image providing a service (think “the process”)
 Host: the computer running the Docker Engine
 Docker Registry: a private or public (Docker Hub) collection of Docker Images
 Docker Machine: provision hosts and install Docker on them
 Docker Compose: create and manage multi-container architectures
 Docker Swarm: orchestrating tool to provision and schedule containers
ARCHITECTURE
Docker uses a client-server architecture. The Docker client talks to the
Docker-daemon, which does the heavy lifting of building, running, and
distributing your Docker containers.
The Docker client and daemon communicate via sockets or through a
RESTful API.
ARCHITECTURE…
 The Docker daemon
• the Docker daemon runs on a host machine. The user does not directly interact with the daemon, but instead
through the Docker client.
 The Docker client
• The Docker client, in the form of the docker binary, is the primary user interface to Docker. It accepts commands
from the user and communicates back and forth with a Docker daemon.
 Docker Internals
• Docker images
• Docker registries
• Docker containers
 How it works?
• You can build Docker images that hold your applications.
• You can create Docker containers from those Docker images to run your applications.
• You can share those Docker images via Docker Hub or your own registry.
DOCKER AND THE KERNEL
 Containers interact with the kernel through system calls
 There are no parts of the kernel or kernel modules inside a container
 A container cannot use a different kernel (version) than the host
 The same kernel is shared by all the containers
DOCKER NETWORKING
 Docs https://docs.docker.com/engine/userguide/networking/dockernetworks/
 Create a Swarm cluster with networking https://github.com/chanezon/docker-
tips/orchestration-networking
 Networking in compose
https://github.com/docker/compose/blob/master/docs/networking.md
 Nathan Leclaire Seamless Docker Multihost Overlay Networking on
DigitalOcean With Machine, Swarm, and Compose, RethinkDB
http://nathanleclaire.com/blog/2015/11/17/seamless-docker-multihost-
overlay-networking-on-digitalocean-with-machine-swarm-and-compose-ft.-
rethinkdb/

Docker : Container Virtualization

  • 1.
    INTRODUCTION TO DOCKER RanjanBaisak (RB) rbaisak@juniper.net
  • 2.
  • 3.
    WHAT IS DOCKER An Open-Source (Go) framework to manage “container virtualization”  Docker isolates multiple user spaces (file systems) inside the same host  The user space instances are called “Containers”  They give you the illusion of being inside a VM  Think about “execution environments” or “sandboxes”  No need for an hypervisor (and so very quick to launch)  Requires x64 Linux and kernel 3.8+
  • 4.
    WHAT IS DOCKER An Open-Source (Go) framework to manage “container virtualization”  Docker isolates multiple user spaces (file systems) inside the same host  The user space instances are called “Containers”  They give you the illusion of being inside a VM  Think about “execution environments” or “sandboxes”  No need for an hypervisor (and so very quick to launch)  Requires x64 Linux and kernel 3.8+
  • 5.
    VIRTUAL MACHINE VSDOCKER Virtual Machines Each virtual machine includes the application, the necessary binaries and libraries and an entire guest operating system - all of which may be tens of GBs in size. Containers Containers include the application and all of its dependencies, but share the kernel with other containers. They run as an isolated process in userspace on the host operating system. They’re also not tied to any specific infrastructure – Docker containers run on any computer, on any infrastructure and in any cloud.
  • 6.
    DOCKER IS NOT A programming language  An OS  A Virtual Machine  An image in the traditional hypervisor-based Virtual Machine concept
  • 7.
    GLOSSARY  Docker, akaDocker Engine: the daemon managing docker images and containers (using namespaces and cgroups). It runs on the (Linux-based) Host.  Docker client: the binary interacting with the Docker Engine.  Docker Image: a filesystem (read-only template) used to create a Container (think “the binary”)  Docker Container: a running image providing a service (think “the process”)  Host: the computer running the Docker Engine  Docker Registry: a private or public (Docker Hub) collection of Docker Images  Docker Machine: provision hosts and install Docker on them  Docker Compose: create and manage multi-container architectures  Docker Swarm: orchestrating tool to provision and schedule containers
  • 8.
    ARCHITECTURE Docker uses aclient-server architecture. The Docker client talks to the Docker-daemon, which does the heavy lifting of building, running, and distributing your Docker containers. The Docker client and daemon communicate via sockets or through a RESTful API.
  • 9.
    ARCHITECTURE…  The Dockerdaemon • the Docker daemon runs on a host machine. The user does not directly interact with the daemon, but instead through the Docker client.  The Docker client • The Docker client, in the form of the docker binary, is the primary user interface to Docker. It accepts commands from the user and communicates back and forth with a Docker daemon.  Docker Internals • Docker images • Docker registries • Docker containers  How it works? • You can build Docker images that hold your applications. • You can create Docker containers from those Docker images to run your applications. • You can share those Docker images via Docker Hub or your own registry.
  • 10.
    DOCKER AND THEKERNEL  Containers interact with the kernel through system calls  There are no parts of the kernel or kernel modules inside a container  A container cannot use a different kernel (version) than the host  The same kernel is shared by all the containers
  • 11.
    DOCKER NETWORKING  Docshttps://docs.docker.com/engine/userguide/networking/dockernetworks/  Create a Swarm cluster with networking https://github.com/chanezon/docker- tips/orchestration-networking  Networking in compose https://github.com/docker/compose/blob/master/docs/networking.md  Nathan Leclaire Seamless Docker Multihost Overlay Networking on DigitalOcean With Machine, Swarm, and Compose, RethinkDB http://nathanleclaire.com/blog/2015/11/17/seamless-docker-multihost- overlay-networking-on-digitalocean-with-machine-swarm-and-compose-ft.- rethinkdb/