Docker Fundamentals
Kalyan Reddy Daida
StackSimplify
Docker
Introduction
Kalyan Reddy Daida StackSimplify
What problems we have with Traditional Infra?
• Traditional Approach
• Installation & Configuration
• Time consuming Webservers AppServers Databases
• Need to perform install/configs on every server and every
environment (dev, qa, staging, production)
• Compatibility & Dependency
• Need to keep resolving issues related to libraries and
dependencies
• Inconsistencies across Environments
• Very hard to track changes across Dev/QA/Staging and Prod
environments and they end up with inconsistencies
• Operational Support Libraries Dependencies
• Need more resources to handle operational issues on day to day
basis
• Server Support (hardware, software)
• Patching releases Operating System
• Developer Environments
• When a new developer joins the team, time it takes to provision
his development environment in traditional approach is time Hardware Infrastructure
taking.
Kalyan Reddy Daida StackSimplify
Physical Machines Virtual Machines
Virtual Machine Virtual Machine
Webservers AppServers Databases Webservers AppServers Databases
Webservers AppServers Databases
Libs Deps Libs Deps
Operating System Operating System
Libraries Dependencies
Hypervisor
Operating System
Hardware Infrastructure Hardware Infrastructure
Kalyan Reddy Daida StackSimplify
Physical Machines with Docker
Container Container Container
Webservers AppServers Databases
Libs Deps Libs Deps Libs Deps
Docker
Operating System
Hardware Infrastructure
Kalyan Reddy Daida StackSimplify
Virtual Machines with Docker
Virtual Machine Virtual Machine
Container Container Container Container Container Container
Webservers AppServers Databases Webservers AppServers Databases
Libs Deps Libs Deps Libs Deps Libs Deps Libs Deps Libs Deps
Docker Docker
Operating System Operating System
Hypervisor
Hardware Infrastructure
Kalyan Reddy Daida StackSimplify
Advantages of using Docker
Even the most complex applications can
Flexible
be containerized.
Containers leverage and share the host kernel, making
Lightweight them much more efficient in terms of system
resources than virtual machines.
You can build locally, deploy to the
Portable
cloud, and run anywhere.
Why Containers ?
Containers are highly self sufficient and
Loosely Coupled encapsulated, allowing you to replace or upgrade
one without disrupting others.
You can increase and automatically distribute
Scalable container replicas across a datacenter.
Containers apply aggressive constraints and isolations
Secure to processes without any configuration required on
the part of the user.
Kalyan Reddy Daida StackSimplify
Docker
Architecture
Kalyan Reddy Daida StackSimplify
Docker - Terminology
• Docker Daemon
• The Docker daemon (dockerd) listens for Docker API requests and manages Docker objects
such as images, containers, networks, and volumes.
• Docker Client
• Docker client can be present on either Docker Host or any other machine. Docker Client (Optional)
• The Docker client (docker) is the primary way that many Docker users interact with Docker.
• When you use commands such as docker run, the client sends these commands to dockerd
(Docker Daemon), which carries them out. Docker Daemon
• The docker command uses the Docker API.
• The Docker client can communicate with more than one daemon.
• Docker Images
Image-1 Container-11
• An image is a read-only template with instructions for creating a Docker container.
• Often, an image is based on another image, with some additional customization.
• For example, we may build an image which is based on the ubuntu image, but installs the
Apache web server and our application, as well as the configuration details needed to make Image-2 Container-21
our application run.
• Docker Containers
• A container is a runnable instance of an image. Images Containers
• We can create, start, stop, move, or delete a container using the Docker API or CLI. Docker Host
• We can connect a container to one or more networks, attach storage to it, or even create a
new image based on its current state.
• When a container is removed, any changes to its state that are not stored in persistent
storage disappear.
Kalyan Reddy Daida StackSimplify
Docker - Terminology
nginxdemos
/hello Docker Daemon
Docker Registry
(Docker Hub)
nginxdemos
Container-11
/hello
Images Containers
Docker Host
docker pull nginxdemos/hello
• Docker Registry or Docker Hub
• A Docker registry stores Docker images. docker run -p 82:80 -d nginxdemos/hello
• Docker Hub is a public registry that anyone can use, and Docker is
configured to look for images on Docker Hub by default. Docker Client (My Desktop or Docker Host)
• We can even run our own private registry.
• When we use the docker pull or docker run commands, the
required images are pulled from our configured registry.
• When we use the docker push command, our image is pushed to
our configured registry.
Kalyan Reddy Daida StackSimplify
Thank You
Kalyan Reddy Daida StackSimplify