What is Docker? 4 -A platform that allows you to “build, ship, and run any app, anywhere.” - Docker is - A command-line program - A background daemon - Set of remote services It accomplishes this using a UNIX technology called containers.
5.
What is Docker? -History of Docker Author: Solomon Hykes Released: March 2013 Main contributors: ❖ The Docker team ❖ Cisco, Huawei, Red Hat ❖ Google, IBM, Microsoft 5
What problems does Dockersolve? 15 - What happens: - One application needs an upgraded dependency but the other does not? - You remove an application? Is it really gone? - Can you remove old dependencies? - Can you remember all the changes you had to make to install the software you now want to remove?
16.
What problems does Dockersolve? - Dependency relationships of example program - Programs running inside containers with copies of their dependencies 16
17.
What problems does Dockersolve? - Quickly experiment with software Docker can give you a sandbox environment in milliseconds 17
What problems does Dockersolve? 21 “Each week we launch more than 2 billion container instances across our global data centers, ... ” Eric Brewer, VP of Google Infrastructure “At Instagram, we deploy our backend code 30–50 times a day… whenever engineers commit changes to master… with no human involvement in most cases.” Michael Gorven, Production Engineer at Facebook
Understanding Docker - Overviewof Docker architecture - The Docker daemon is the hub of your interactions with Docker - Try to curl post/get unix-socket 24
Docker Image/Volumes 30 - Waysto create a new Docker image - Docker command “By Hand” - Create a new image with docker commit - Dockerfile - Text file with a series of commands - Dockerfile and configuration management (CM) tool - Building images with Chef Solo/Ansible - Scratch image and import a set of files - Converting your VM to a container
31.
Docker Image/Volumes - Writinga Dockerfile - A Dockerfile is a text file with a series of commands in it - Docker Instructions 31
32.
Docker Image/Volumes - Whatis Volumes - A volume is a mount point on the container’s directory tree where a portion of the host directory tree has been mounted. 32
33.
Docker Image/Volumes 33 - Volumesprovide container-independent data management - Create modularity for architectural components. - Inject behavior into containers without modifying an image.
34.
Docker Image/Volumes - Volumetypes - Bind mount volume - Managed volume - Volume can be sharing between containers 34
35.
Docker Registry - Onceyou’ve created your images, you may want to share them with other users. 35
36.
Docker Registry - Dockerregistry - Private network - Public network - Allow - Multiple users to push and pull images from a central store using a RESTful API. - Open source - https://github.com/docker /distribution 36
Docker Registry - DockerHub - A registry maintained by Docker, Inc - Tens of thousands of images ready to download and run - Free for public repositories (images) - Paid for private repositories (images) 38
Docker Network 45 - Exposingand publishing ports - Exposing ports is a way of documenting which ports are used, but does not actually map or open any ports - Publishing port tells Docker which ports to open on the container’s network interface and mapped to an available port on the host machine - Links - Allow a container to resolve another container’s name to an IP address
46.
Native Clustering 46 - Whatis a node? - An instance of the Docker engine participating in the swarm - Types of node - Manager node - Worker node - Services and tasks - Replicated services - Global services - Load balancing
Docker Compose 52 - DockerCompose - A tool for defining and running multi-container Docker applications - Great for development, testing, and staging environments - 3 steps to use Docker Compose - Define your app’s environment with a Dockerfile - Define the services in docker-compose.yml - Run docker-compose up
53.
Docker Compose - Getstarted - Build application count the number of hits the site - Python/Flask + Redis 53