What Is A Docker Container Docker Container Tutorial For Beginners Docker Container Simplilearn
What Is A Docker Container Docker Container Tutorial For Beginners Docker Container Simplilearn
CONTAINER?
Standard Machine
HOSt OS
Infrastructure
lear
n
Standard Machine Virtual Machine
Bins/Libs Hypervisor
HOSt OS Host OS
Infrastructure Infrastructure
lear
n
Standard Machine Virtual Machine Docker Container
App App 1
App Docks Docker Doc
1
A , B B Colane 1 Colane 2 Coclnm 3
, i
Bins/Libs Bins/Libs i Bins/Libs i
'
App App App C
1
i A I
B
l
1I
1 '
Guest OS Guest OS 1 Guest OS i I
App App App C '
Bins/Libs Bins/Libs Bins/Libs
A B • - • 1- - i- - - - - - • i
Bins/Libs Hypervisor Docker Engine
lear
n
Standard Machine Virtual Machine Docker Container
App App B 1
App B Docker Doc er Doc
1
A Cabane 1 Cabane
e
Bins/Libs Bins/Libs Bins/Libs i 2 Cocanw 3 i
App App B App C
II
A
i i '
Guest OS Guest OS Guest OS i I
App B App C Bins/Libs Bins/Libs Bins/Libs
i
lear
n
Standard Machine Virtual Machine Docker Container
t Bins/Libs , Bins/Libs
1
Bins/Libs i i
1 App App B
'
App C
i A I
I 1
i i l
i 1
' Guest OS i Guest OS Guest OS i
Bins/Libs Bins/Libs Bins/Libs
i
Note: Application A works fine along with its dependency (Bins/Libs), but ApDlication B and C will not work as it doesn't have
its dependencies
learn
Standard Virtual Machine Docker Container
Machine
VÏrtUal
Machine 1
Note: Guest OS occupies more space and leads to unstable performance lear
Standard Virtual Docker Container
Machine Machine
Virtual
Machine 1
App App 1
App Docker Docker Doc
1
A B B i Colane 1 CoYane
e
Bins/Libs , Bins/Libs Bins/Libs 2 Cmclnw 3
i
1
App
A
Bins/ Hyperviso Docker
Libs r Engine
HOSt OS Host HOSt
OS OS
Infrastructure Infrastructure Infrastructure
Note: Unlike Virtual machine, Containers are efficient and are easily portable across different
platforms
lear
Standard Machine Virtual Machine Docker Container
VÏrtUal
Docker Docker Doc<er
Machine 1 _ Machine 3
_ M_ C ontainer Container 2 Container 3
1
a_c_hin_ e_ 2_
App A App B App
_ B
Bins/Libs t , Bins/Libs i Bins/Libs
App A Hypervisor
lear
Why Docker Container?
Host HO5t OS
OS
Infrastructure Infrastructure
'
A developer will setup a JBoss
A developer will setup a JBoss After the application is developed
software on his system it is examined by the
testing team
•'• Demo
lear
What is Docker?
Docker is an open source platform that helps a user to package an application and it's dependencies into a Docker
Container for the development and deployment of soñware
Docker Container
lear
n
Docker is an open source plaLorm that helps a user to package an application and it's dependencies into a Docker
Container for the development and deployment of soñware
Run
Build Ship
lear
n
Before starting with Docker
containers, let‘s understand
the architecture of Docker
lear
n
Architecture of Docker
Architecture of Docker
i REST API
i
simpl¡Iear
n
Architecture of Docker
i REST API
i
simpl¡Iear
n
i REST API
i
Docker Daemon checks the client
request and communicates with the
Docker components in order to
perform a service
Docker Registry
learn
i REST API
i
Docker Daemon checks the client
request and communicates with the
Docker components in order to
perform a service
Docker Registry
learn
Architecture of Docker
i REST API
i
simpI¡Iearn
Architecture of Docker
i REST API
i
Docker Registry is a service used for
hosting and distributing Docker images
among users
What is a Docker Container?
. 1
Docker Container is an executable software package that includes all dependencies (frameworks, libraries, etc.) required
to execute an application
With Docker Containers, applications can work ePiciently in different computer environments
Docker Container
learn
. 3
Docker Container is an executable software package that includes all dependencies (frameworks, libraries, etc.) required
to execute an application
With Docker Containers, applications can work ePiciently in different computer environments
Docker Container
learn
. 3
Docker Container is an executable software package that includes all dependencies (frameworks, libraries, etc.) required
to execute an application
With Docker Containers, applications can work ePiciently in different computer environments
Docker Container
learn
Docker Container is an executable software package that includes all dependencies (frameworks, libraries, etc.) required
to execute an application
With Docker Containers, applications can work efficiently in different computer environments
Lightweight
Docker Container
learn
Docker Container is an executable so2ware package that includes all dependencies (frameworks, libraries, etc.) required
to execute an application
With Docker Containers, applications can work ePiciently in different computer environments
Lightweight
Docker Container
learn
Docker Container is an executable software package that includes all dependencies (frameworks, libraries, etc.) required
to execute an application
With Docker Containers, applications can work ePiciently in different computer environments
Lightweight
Docker Container
learn
Docker Container is an executable software package that includes all dependencies (frameworks, libraries, etc.) required
to execute an application
With Docker Containers, applications can work egiciently in different computer environments
lear
n
How to create a Docker Container?
• Docker File creates a Docker Image using the build command
Docker Image
Docker
File
Note: A Docker File is a text file which contains commands for building a Docker Image :
How to create a Docker Container?
Docker Image
Docker Project code
File
.:lear
Flow :› cre !e a Docl.-‹ Contcio r
r
Docker File creates a Docker Image using the build command
With Docker Image, a user can run the code in order to create Docker Containers
Docker Image
Docker
File
Docker
Container
Docker Image
Docker Docker Registry
File
Docker
Container
lear
n
• Once the Docker Image is created, it can be stored in the Docker Registry using Docker push command (Docker push
image name)
Docker Image
Docker Docker Registry
File
lear
n
• Once the Docker Image is created, it can be stored in the Docker Registry using Docker push command (Docker
push image name)
Docker Image
Docker Docker Registry
File
Docker
Container
Note: Docker also has its own default Registry called Docker Hub ’. ,learn
• There are multiple Docker images available in the registry and all can be retrieved through the Docker pull
command (e.g. Docker pull image name)
Docker Image
Docker Docker Registry
File
Docker
Container
Once a Docker Image is retrieved from the Docker Registry, a user can build new Containers
Container
Container
Docker Image
Docker Docker Registry
File
Docker
Container
lear
n
Now, Let's create a Container usinğ
basic Docker commands
lear
n
How to create a Docker Container?
i REST API
I
i
i
Note: Docker uses Docker images to run your code, not the Dockerfile
si I•lear
m n
How to create a Docker Container?
REST API
When you run pull command, Docker
Image (NGNIX) is retrieved from the
registry
Docker Registry
How to create a Docker Container?
i REST API
When you run pull command, Docker i
i
Image (NGNIX) is retrieved from the i
registry
Docker Registry
.lear
Benefits of Containers
- c‹”‹efiîs .of î?c
lear
n
Benefits of Containers
lear
n
Containers have no external Data volumes can be shared
dependency for applications to and reused among multiple
run Containers
lear
n
Benefits of Containers
.learn
Is it possible to run multiple
Containers together withOUt the
need to start each one
Well, it's possible with Docker individually?
compose !
lear
n
Docker Compose can be used to run multiple Containers in a single service
Consider an instance where you have an application which requires Apache Tomcat and redis.
Now, you can easily create one Docker Compose file to run both Containers in a single service
Docker
Compose file
redis learn
Basic Docker Container commands
• Docker Container commit - Command to create a new Docker image from the changes made in Container
• Docker Container cp - Command to copy files between the local filesystem and a Docker Container
learn