SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Containerization and Docker
Megha Bansal
What is a Container?
Package Software into Standardized
Units for Development, Shipment and
Deployment
Comparing
Containers and
Virtual Machines
Containers and virtual machines have similar
resource isolation and allocation benefits, but
function differently because containers
virtualize the operating system instead of
hardware. Containers are more portable and
efficient.
CONTAINERS
Containers are an abstraction at the app
layer that packages code and
dependencies together. Multiple containers
can run on the same machine and share
the OS kernel with other containers, each
running as isolated processes in user
space. Containers take up less space than
VMs (container images are typically tens of
MBs in size), can handle more applications
and require fewer VMs and Operating
VIRTUAL MACHINES
Virtual machines (VMs) are an abstraction
of physical hardware turning one server
into many servers. The hypervisor allows
multiple VMs to run on a single machine.
Each VM includes a full copy of an
operating system, the application,
necessary binaries and libraries - taking
up tens of GBs. VMs can also be slow to
boot.
Technology
Behind VMs
and
Containers
An open-source
containerization platform that
allows you to containerize your
applications
According to the Stack Overflow
Developer Survey - 2020,
Docker is the
#1 most wanted platform
#2 most loved platform
#3 most popular platform
Underlying
Technology
• Docker is written in the Go
programming language and takes
advantage of several features of
the Linux kernel to deliver its
functionality. Docker uses a
technology called namespaces to
provide the isolated workspace
called the container. When you run
a container, Docker creates a set
of namespaces for that container.
• These namespaces provide a layer
of isolation. Each aspect of a
container runs in a separate
namespace and its access is
limited to that namespace.
Architecture of
Docker
The engine consists of three major components:
• Docker Daemon: The daemon (dockerd) is a process that
keeps running in the background and waits for commands from
the client. The daemon is capable of managing various Docker
objects.
• Docker Client: The client (docker) is a command-line interface
program mostly responsible for transporting commands issued
by users.
• REST API: The REST API acts as a bridge between the daemon
and the client. Any command issued using the client passes
through the API to finally reach the daemon.
According to the official docs,
"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".
You as a user will usually execute commands using the client
component. The client then use the REST API to reach out to the
long running daemon and get your work done.
The Full Picture
The events that occur when you execute the command are as follows:
• You execute docker run hello-world command where hello-world is the name of an image.
• Docker client reaches out to the daemon, tells it to get the hello-world image and run a container from
that.
• Docker daemon looks for the image within your local repository and realizes that it's not there, resulting in
the Unable to find image 'hello-world:latest' locally that's printed on your terminal.
• The daemon then reaches out to the default public registry which is Docker Hub and pulls in the latest copy
of the hello-world image, indicated by the latest: Pulling from library/hello-world line in your
terminal.
• Docker daemon then creates a new container from the freshly pulled image.
• Finally, Docker daemon runs the container created using the hello-world image outputting the wall of text
on your terminal.
• It's the default behavior of Docker daemon to look for images in the hub that are not present locally. But once an
image has been fetched, it'll stay in the local cache. So, if you execute the command again, you won't see the
following lines in the output:
• If there is a newer version of the image available on the public registry, the daemon will fetch the image again.
That :latest is a tag. Images usually have meaningful tags to indicate versions or builds.
Docker
Container
Manipulation
Basics
1) How to run a container?
docker run <image-name>
Prior to version 1.13, Docker had only the previously mentioned command
syntax.
Later on, the command-line was restructured to have the following syntax:
docker <object> <command> <options>
In this syntax:
• object indicates the type of Docker object you'll be manipulating. This
can be
a container, image, network or volume object.
• command indicates the task to be carried out by the daemon, that is
the run command.
• options can be any valid parameter that can override the default
behavior of
the command, like the --publish option for port mapping.
2) How to publish a port?
Containers are isolated environments. Your host system doesn't know anything about what's going on inside a container.
Hence,
applications running inside a container remain inaccessible from the outside. To allow access from outside of a container,
you must
publish the appropriate port inside the container to a port on your local network. The common syntax for the --publish or -p
option is as follows:
--publish <host port>:<container port>
Now to access the application on your browser, visit http://127.0.0.1:8080
3) How to list Containers?
The container ls command can be used to list out containers that are currently running.
To do so execute following
4) How to stop or kill a running Container?
docker container stop <container identifier>
Where container identifier can either be the id or the name of the container.
5) How to restart a Container?
When we say restart we mean two scenarios specifically. They are as follows:
• Restarting a container that has been previously stopped or killed.
• Rebooting a running container.
docker container start <container identifier>
USE CASE-
DOCKER
https://medium.com/analytics-
vidhya/task-1-github-jenkins-and-
docker-integration-d3b7c1d60bb6
REFERENCES
• https://cloud.google.com/containers
• https://www.docker.com/resources/what-container
• https://www.freecodecamp.org/news/the-docker-handbook/
• https://docs.docker.com/get-started/overview/
Thank You!

Weitere ähnliche Inhalte

Was ist angesagt?

Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Simplilearn
 

Was ist angesagt? (20)

Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016
 
Docker basics
Docker basicsDocker basics
Docker basics
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An Introduction
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Introduction to container based virtualization with docker
Introduction to container based virtualization with dockerIntroduction to container based virtualization with docker
Introduction to container based virtualization with docker
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
 
Docker
DockerDocker
Docker
 
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
 
Docker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker SlidesDocker Birthday #3 - Intro to Docker Slides
Docker Birthday #3 - Intro to Docker Slides
 
Docker
DockerDocker
Docker
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker Swarm for Beginner
Docker Swarm for BeginnerDocker Swarm for Beginner
Docker Swarm for Beginner
 
Docker intro
Docker introDocker intro
Docker intro
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basics
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
 
Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and image
 

Ähnlich wie Containerization and Docker

Ähnlich wie Containerization and Docker (20)

Hack the whale
Hack the whaleHack the whale
Hack the whale
 
Docker
DockerDocker
Docker
 
Introduction to Dockers and containers
Introduction to Dockers and containers Introduction to Dockers and containers
Introduction to Dockers and containers
 
Dockers and containers basics
Dockers and containers basicsDockers and containers basics
Dockers and containers basics
 
Docker : Container Virtualization
Docker : Container VirtualizationDocker : Container Virtualization
Docker : Container Virtualization
 
Docker interview Questions-2.pdf
Docker interview Questions-2.pdfDocker interview Questions-2.pdf
Docker interview Questions-2.pdf
 
containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )containers and virtualization tools ( Docker )
containers and virtualization tools ( Docker )
 
Docker
DockerDocker
Docker
 
What is Docker?
What is Docker?What is Docker?
What is Docker?
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
 
Let's dockerize
Let's dockerizeLet's dockerize
Let's dockerize
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 
Docker
DockerDocker
Docker
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with docker
 
Docker basics
Docker basicsDocker basics
Docker basics
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Containerization and Docker

  • 2. What is a Container? Package Software into Standardized Units for Development, Shipment and Deployment
  • 3. Comparing Containers and Virtual Machines Containers and virtual machines have similar resource isolation and allocation benefits, but function differently because containers virtualize the operating system instead of hardware. Containers are more portable and efficient.
  • 4. CONTAINERS Containers are an abstraction at the app layer that packages code and dependencies together. Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in user space. Containers take up less space than VMs (container images are typically tens of MBs in size), can handle more applications and require fewer VMs and Operating VIRTUAL MACHINES Virtual machines (VMs) are an abstraction of physical hardware turning one server into many servers. The hypervisor allows multiple VMs to run on a single machine. Each VM includes a full copy of an operating system, the application, necessary binaries and libraries - taking up tens of GBs. VMs can also be slow to boot. Technology Behind VMs and Containers
  • 5. An open-source containerization platform that allows you to containerize your applications According to the Stack Overflow Developer Survey - 2020, Docker is the #1 most wanted platform #2 most loved platform #3 most popular platform
  • 6. Underlying Technology • Docker is written in the Go programming language and takes advantage of several features of the Linux kernel to deliver its functionality. Docker uses a technology called namespaces to provide the isolated workspace called the container. When you run a container, Docker creates a set of namespaces for that container. • These namespaces provide a layer of isolation. Each aspect of a container runs in a separate namespace and its access is limited to that namespace.
  • 8. The engine consists of three major components: • Docker Daemon: The daemon (dockerd) is a process that keeps running in the background and waits for commands from the client. The daemon is capable of managing various Docker objects. • Docker Client: The client (docker) is a command-line interface program mostly responsible for transporting commands issued by users. • REST API: The REST API acts as a bridge between the daemon and the client. Any command issued using the client passes through the API to finally reach the daemon. According to the official docs, "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". You as a user will usually execute commands using the client component. The client then use the REST API to reach out to the long running daemon and get your work done.
  • 9. The Full Picture The events that occur when you execute the command are as follows: • You execute docker run hello-world command where hello-world is the name of an image. • Docker client reaches out to the daemon, tells it to get the hello-world image and run a container from that. • Docker daemon looks for the image within your local repository and realizes that it's not there, resulting in the Unable to find image 'hello-world:latest' locally that's printed on your terminal. • The daemon then reaches out to the default public registry which is Docker Hub and pulls in the latest copy of the hello-world image, indicated by the latest: Pulling from library/hello-world line in your terminal. • Docker daemon then creates a new container from the freshly pulled image. • Finally, Docker daemon runs the container created using the hello-world image outputting the wall of text on your terminal.
  • 10. • It's the default behavior of Docker daemon to look for images in the hub that are not present locally. But once an image has been fetched, it'll stay in the local cache. So, if you execute the command again, you won't see the following lines in the output: • If there is a newer version of the image available on the public registry, the daemon will fetch the image again. That :latest is a tag. Images usually have meaningful tags to indicate versions or builds.
  • 11. Docker Container Manipulation Basics 1) How to run a container? docker run <image-name> Prior to version 1.13, Docker had only the previously mentioned command syntax. Later on, the command-line was restructured to have the following syntax: docker <object> <command> <options> In this syntax: • object indicates the type of Docker object you'll be manipulating. This can be a container, image, network or volume object. • command indicates the task to be carried out by the daemon, that is the run command. • options can be any valid parameter that can override the default behavior of the command, like the --publish option for port mapping.
  • 12. 2) How to publish a port? Containers are isolated environments. Your host system doesn't know anything about what's going on inside a container. Hence, applications running inside a container remain inaccessible from the outside. To allow access from outside of a container, you must publish the appropriate port inside the container to a port on your local network. The common syntax for the --publish or -p option is as follows: --publish <host port>:<container port> Now to access the application on your browser, visit http://127.0.0.1:8080 3) How to list Containers? The container ls command can be used to list out containers that are currently running. To do so execute following
  • 13. 4) How to stop or kill a running Container? docker container stop <container identifier> Where container identifier can either be the id or the name of the container. 5) How to restart a Container? When we say restart we mean two scenarios specifically. They are as follows: • Restarting a container that has been previously stopped or killed. • Rebooting a running container. docker container start <container identifier>
  • 15. REFERENCES • https://cloud.google.com/containers • https://www.docker.com/resources/what-container • https://www.freecodecamp.org/news/the-docker-handbook/ • https://docs.docker.com/get-started/overview/