0% found this document useful (0 votes)
42 views

What Is A Docker Container Docker Container Tutorial For Beginners Docker Container Simplilearn

The document compares standard machines, virtual machines, and Docker containers. A standard machine runs applications and dependencies directly on the host operating system. A virtual machine emulates an entire hardware environment and runs an isolated operating system and applications. A Docker container isolates applications from the host operating system but shares resources for efficiency, allowing applications and dependencies to run seamlessly on any infrastructure.

Uploaded by

Sujatas More
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

What Is A Docker Container Docker Container Tutorial For Beginners Docker Container Simplilearn

The document compares standard machines, virtual machines, and Docker containers. A standard machine runs applications and dependencies directly on the host operating system. A virtual machine emulates an entire hardware environment and runs an isolated operating system and applications. A Docker container isolates applications from the host operating system but shares resources for efficiency, allowing applications and dependencies to run seamlessly on any infrastructure.

Uploaded by

Sujatas More
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 61

T H AT US A DOCKER

CONTAINER?
Standard Machine

App A App B App


C
Bins/Libs

HOSt OS

Infrastructure

lear
n
Standard Machine Virtual Machine

App A App B App B

Bins/Libs Bins/Libs i Bins/Libs i

Guest OS Guest OS Guest OS


App A App B App C

Bins/Libs Hypervisor

HOSt OS Host OS

Infrastructure Infrastructure

lear
n
Standard Machine Virtual Machine Docker Container

Virtual Virtual Vii tual


Macho ne 1 Mach One 2
Machine 3

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

HOSt OS Host OS HOSt


OS
Infrastructure Infrastructure Infrastructure

lear
n
Standard Machine Virtual Machine Docker Container

VÎrtUal Ji h i l l Vii Dual


Macho ne 1 Machine 2 Machine 3

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

Hypervisor Docker Engine

HOSt OS Host OS Host OS

Infrastructure Infrastructure Infrastructure

lear
n
Standard Machine Virtual Machine Docker Container

Virtual Vii tual


Machine 2 Machine 3

App App B App B , Docker Docrei Docker


A , Container 1 Container 2 Container 3

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

Hypervisor Docker Engine

HOSt OS Host OS HOSt OS

Infrastructure Infrastructure Infrastructure

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

App App App Docker Docrei’ Doc<er


A B B Container 1 Container 2 Ccntainer 3

Bins/Libs Bins/Libs i Bins/Libs i i


'
AppA 1' App App C
i II
1 B
1 I I
1 i, i
App Bins/Libs , Bins/ Bins/Libs
A Libs
I ___ ___ ¿
Bins/Libs Hypervisor Docker Engine

HOSt OS Host OS HOSt


OS
Infrastructure Infrastructure Infrastructure

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

Bins/Libs Hyperviso Docker Engine


r
HOSt OS Host HOSt OS
OS
Infrastructure Infrastructure Infrastructure

lear
Why Docker Container?

Docker Docker Docker Docker Docker Docker


Container Container 2 Container 3 Container CDntainer 2 Container 3
1 1
II
!I & pqihon
!
•1
.N@’” M’ ""
f

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

Here the tester repeats the


installation process of JBoss
•t• What is Docker* @OC#OF
•'• Architecture of Docker

•! What is a Docker Containers

How to create a Docker Container?

I Benefits of Docker Containers

•.• Basic Commands of Containers

•'• 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

Developer Docker Container


Tester

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

A Docker Image is a file of instructions


which is used to create Containers

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

Applications run in isolation

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

Applications run in isolation

Occupies less space

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

Applications run in isolation

Occupies less space

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

Applications run in isolation

Occupies less space

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

Applications run in isolation

Occupies less space

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

Applications run in isolation

Occupies less space

Lightweight Short boot-up time


Docker Container '

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 File creates a Docker Image using the build command

A Docker Image contains of all the project's code

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

A Docker Image contains of all the project's code

With Docker Image, a user can run the code in order to create Docker Containers

Docker Image
Docker
File

Docker
Container

Note: Command to run a Docker Container is Docker run <image-id> ,lear


• 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

lear
n
• Once the Docker Image is created, it can be stored in the Docker Registry using Docker push command (Docker push
image name)

• When a Docker Image is created, it gets stored in a Docker Hub or in a Repository

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)

• When a Docker Image is created, it gets stored in a Docker Hub or in a Repository

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

Note: In Docker Registry, repository is a collection of Docker Images ,


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)

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?

in Docket a Docke i e is used to


build the image using
and that image is stored
into the registry using

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

Finally, a single Container (NGNIX) is i


built using Docker Image through the
run command
I
. . . .I
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...lear
Note: Docker Image has multiple image layers and each Image layer is created by executing each command in the Dockerfile

.lear
Benefits of Containers
- c‹”‹efiîs .of î?c

Containers have no external


dependency for applications to
run

lear
n
Benefits of Containers

Containers have no external


dependency for applications to
run

As Containers are light-weight, they are


easily shipped (deployed) to other
computers and get executed on other
computer environments regardless of their
host operating systems

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

Containers have no external Data volumes can be shared


dependency for applications to and reused among multiple
run Containers

Containers run applications in


isolation and also share the OS
kernel with other 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

• Docker Container prune Command to remove all stopped Containers

• Docker Container kill - Command to terminate one or more running Containers

• Docker Container exec - Command to run a new command in a running Container

• Docker Container Is - Command to list Docker Containers

• Docker Container rm - Command to remove one or more Containers

• Docker Container restart Command to restart one or more Containers

learn

You might also like