Professional Documents
Culture Documents
18220856-013
Days before containers
• A software called hypervisor is used to allow for different virtual machines to run
on single physical server.
linux:
• linux containers contain applications that keeps them isolated from host
machine or physical server.
• these Containers allow developer to package up an app with its
libraries ,dependencies etc.
• In linux containers we can break down a program into small pieces to
deliver .
cont
Window containers:
• Traditionally containers are operated by linux but they also work on mac
os and windows.
• In this containers is separted from host machine resources like storage and
ram.
NIDA IMTIAZ
18220856-037
What is Docker
• Docker say that you just containerized your software that it will be
guarantee to run.
• It’s would not be wrong to say that Docker made container simple.
Cont..
• When we say Docker we are talking about the entire ecosystem of Docker
products.
• Docker is a platform that runs each and every application segregated and
securely by the use of kernel containerization feature.
• Docker Image is a set of files which has no state.
• Docker Container is the instantiation of Docker Image. In other
words, Docker Container is the run time instance of images
Open Container Initiative(OCI)
The Open Container Initiative is a Linux Foundation project to design open
standards for operating-system-level virtualization, most importantly Linux
containers. There are currently two specifications in development and in use:
• Runtime Specification
• Image Specification
Cont..
1- Update the apt package index 2- install latest version of Docker and containered
1. Docker Client
2. Docker daemon (server)
18220856-012
contents
The Docker engine is the core software that runs and manages containers
The Docker engine is made from many specialized tools that work together to create and
run containers, images, APIs, runtime etc.
Major components
5
Major components….
1. Docker Client:
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 , which carries them out
2. Docker Daemon:
Docker Daemon listens to Docker API request and manages Docker objects such as images, containers,
networks.
3. Container d
Container d act as a bridge between the daemon and runc.
It is responsible for:
Starting and Stopping Containers.
Pausing and Un-pausing Containers.
Destroying the Containers.
4. shim
Shim makes possible to perform maintenance and upgrades on the docker daemon without impacting
docker containers.
5. run c
run c often refer as a container runtime. It has a single purpose in life is to create containers.
Images
An image is lightweight, standalone, executable packages of software that includes everything needed to
run an application.
Images are used to create a container. we can create multiple containers from one image that runs as an
instance of an image.
e.g:-
Code
Runtime
System tools
System Libraries
Settings
In this way, each layer contains different things required to run a containerized app.
Common layer among different images are downloaded and are stored only once. Then are used
in all images.
You build container based on images and that is why images are sometimes called stopped
containers.
□ The extremely small size image example is ; Apline Linux Docker image of 4MB in size.
1. Offical Repository:
These contains images that have been verified by Docker,inc
e.g. Docker Ubuntu image
2. Unoffical Repository:
common user of docker hub can use it by sign in.
You can pull (download) and push (upload) images from this link:
www.hub.docker.com
Image naming and tagging
□ To Address images from official repo. We have to give repos. Name and tag
seprated by colon (:)
□ Pulling images from unofficial repos. We also have to add your docker hub username before
repos. Name
>> docker image pull mussab/helloworld:latest
2. Removing images:
Docker containers
□ From image you create a copy of your app that is up and running.
□ In the same way we can start a virtual machine (VM ) from a virtual machine
templete.
□ The big difference between VM and container is that containers are faster and
light weight.
□ Run in Interective mode:
□ Now press ctrl + PQ (it will not stop container on leaving it)
□ Check all containers:
□ To go to running container:
>> docker exec –it abc sh
Note: Abc is any name & 123 is id that is assigned auto. To container.
□ List running containers:
>> docker container ls
or
>> docker ps
18220856-027
Thank You!