Intro to Docker
©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Agenda
Issues we faced Before Containerization
What is a container?
Container vs VM
Why do we Need Containers ?
What is Docker?
©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Agenda
Docker Installation and setup
Docker Environment
Docker Architecture
Q/A
©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Issues we faced before Containerization
Issues we faced before Containerization
Developer Tester
Standard Delivery Pipeline
Issues we faced before Containerization
Operating Pytest 5.4.3 Pycharm IDE
System
Backend Code Dependencies
Backend Developer
Developer’s Environment
Issues we faced before Containerization
Operating Pytest 5.3.0 Spyder IDE
System
Backend Code Dependencies
Tester
Tester’s Environment
Issues we faced before Containerization
Developer Tester
- This Code runs fine on my computer - This Code does not run on my system
Issues we faced before Containerization
Developer Tester
Operating Pytest 5.4.3 Pycharm IDE Operating Pytest 5.3.0 Spyder IDE
System System
Backend Code Dependencies Backend Code Dependencies
Issues we faced before Containerization
- Now Let’s see what happens
when we introduce Containers.
Issues we faced before Containerization
- This Code runs fine on my
computer - This Code runs fine on my
computer
Developer Tester Prod
Similar Delivery Pipeline but with containers
What is a Container?
What is a Container?
Containers are software that wrap up all the parts of a code and all its
dependencies into a single deployable unit that can be used on
different systems and servers.
Code Libraries
Container Systems & Servers
What is a Container?
You can compare Containers to VM to get a better Idea.
Container VM
Container
vs
VM
Container vs VM
Let’s set some criteria to compare them
• Operating Systems
• Architecture
• Isolation
• Efficiency
• Portability
• Scalability
• Deployment
Container vs VM
Operating System
Container VM
Contains only the bare minimum Contains the complete Operating
parts of the Operating system system that is normally used on
required to run the software. systems for general purpose.
Updates are easy and simple to Updates are time consuming and
do tough.
Container vs VM
Architecture
Container VM
Host Container Host VM
Apps Services Apps Services Apps Services Apps Services
Kernel Kernel Kernel
OS OS OS
Hardware Hardware
Container vs VM
Isolation
Container VM
The isolation provided by a VM provides complete
container isn’t as complete isolation from the
as of a VM but is concerning host system
adequate. and is also more secure.
Container vs VM
Efficiency
Container VM
Container are way more VM are less efficient as
efficient as they only utilise they have to manage full
the most necessary parts blown guest operating
of the Operating system. system. VM’s have to
They act like any other access host resource
software on the host through a hypervisor.
system
Container vs VM
Portability
Container VM
Containers are self- VMs aren’t that easily
contained environments ported with the same
that can easily be used on settings from one operating
different Operating system to another.
systems,
Container vs VM
Scalability
Container VM
Containers are very easy to scale, VMs aren’t very easily scalable
they can be easily added and as they are heavy in nature.
removed based on requirements
due to their light weight.
Container vs VM
Deployment
Container VM
Containers can be VMs can be deployed by
deployed easily using the using the powershellor by
Docker CLI or making use using the VMM or using
of Cloud services provided cloud services such as aws
by aws or azure. or azure.
Why do we need Containers?
Why do we need Containers?
Consistent Development
Mircoservices
Environments
Developer Tester Prod
What is Docker?
What is Docker?
Docker is a tool that helps in developing, building, deploying and
executing software in isolation. It does so by creating containers
that completely wrap a software.
The Isolation provided by container gives a layer of
security to the containers.
Why Docker?
Simple Fast Easy Collaboration
Built for Developers,
Docker Community
by Developers
Docker Installation & Setup
Docker Installation & Setup
Linux Windows MAC
Docker Environment
Docker Environment
Docker Engine Docker Objects Docker Registry
Docker Compose Docker Swarm
Docker Engine
Docker Engine
Docker engine is as the name suggests, its technology that allows for
the creation and management of all the Docker Processes. It has three
major parts to it.
Docker CLI Docker API Docker Daemon
Docker Objects
Docker Objects
Docker Images Docker Containers Docker Volumes
Docker Swarm
Docker Networks
Nodes & Services
Docker Objects - Images
Docker images are sets of instructions that are used to create
containers and execute code inside it.
Docker Common Commands
Docker Objects - Volumes
Docker Volumes are basically persistent storage locations for the
containers. They can be easily & safely attached and removed from
different container. And they are also portable from system to another.
Docker Objects – Volumes drivers
Docker Volumes drivers allow you to perform unique abilities such as
creating persistent storage on other hosts, cloud, encrypt Volumes.
They basically enhance the abilities of a Volume.
Docker Objects - Network
A Docker network is basically a connection between one or more
containers.One of the more powerful things about the Docker
containers is that they can be easily connected to one other and even
other software, this makes it very easy to isolate and manage the
containers
Docker Registry
Docker Registry
You can think of registries as storage locations for Docker Images.
These images can be versioned in the registry as well.
Docker Image 1
Docker Image 2
Docker Registry
Docker Image 3
Docker Registry – DockerHub
You have many options for a Docker Registry, you can go with
DockerHub as your main Docker registry as there is already a Docker
command to pull and push images to it. If you don’t want to use
DockerHub there are many alternatives to it.
Docker Objects – Registry
Right! Let’s create our own
DockerHub account and then
let’s try and pull and push
images.
Docker Compose
Docker Compose
For Now let’s just understand that Docker Compose is just a Service
within Docker that let’s us launch multiple containers at the same time.
Docker Swarm
Docker Swarm
For Now just understand that Docker Swarm is a service within Docker
that allows us to manage multiple containers.
Manager Node
Worker Node
Docker Architecture
Docker Architecture
Docker CLI Docker Host Docker Registry
Docker build Docker Daemon
Containers Images
Docker pull
Docker run
What is a Container?
Multiple isolated containers can be launched together to form
Microservices which can be easily managed using any orchestration
tool e.g. Docker Swarm, Kubernetes, etc.
O
R
Q&A
©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited