Visualising Basic Concepts of Docker

43
Docker & docker run vishnu

Transcript of Visualising Basic Concepts of Docker

Page 1: Visualising Basic Concepts of Docker

Docker &

docker run vishnu

Page 2: Visualising Basic Concepts of Docker

What is Docker ?

Page 3: Visualising Basic Concepts of Docker

What is Docker ?

It’s a Application Delivery Technology.

Page 4: Visualising Basic Concepts of Docker

Terminology Briefing● Docker or Docker Engine

● Docker Host

● Docker Daemon

● Docker Container

Page 5: Visualising Basic Concepts of Docker

Qns: Docker Container = VM ?

Page 6: Visualising Basic Concepts of Docker

Qns: Docker Container = VM ?

Ans: NO

Page 7: Visualising Basic Concepts of Docker

House Apartment ’s

Page 8: Visualising Basic Concepts of Docker

1 - Virtual Machine Many Containers

Page 9: Visualising Basic Concepts of Docker

Motivation● Isolation

● Lightweight when compared to VM

○ Multiple docker containers share the underlying

resources of the docker host.

Page 10: Visualising Basic Concepts of Docker
Page 11: Visualising Basic Concepts of Docker

Terminology Briefing

● Docker Image

● Docker Container

Page 12: Visualising Basic Concepts of Docker

Biggest Motivation:

Its an Application Delivery Mechanism !

Page 13: Visualising Basic Concepts of Docker

Qns: How do we deliver our Apps ?

Page 14: Visualising Basic Concepts of Docker

Qns: How do we deliver our Apps ?

Ans:In docker terms, we create and ship

DOCKER - IMAGE

Page 15: Visualising Basic Concepts of Docker

This is an open Container

Page 16: Visualising Basic Concepts of Docker

This a Manifest for the open container.

Page 17: Visualising Basic Concepts of Docker

The Cargo for your container

Obviously you

declare all this

in the manifest !

Page 18: Visualising Basic Concepts of Docker

Close it , i.e build it - and you have an image.

Page 19: Visualising Basic Concepts of Docker

My Analogy

● Open Container = Docker build directory

● Container Manifest = Docker build File

● The Cargo = The necessary things to run your App

● Properly Closed Container = Properly Built Image

Page 20: Visualising Basic Concepts of Docker

Concept of layers in an Image

Each Box of cargo you add forms a LAYER in an image.

You can add a new LAYER on TOP of the previous layer.

Hint :- stack of pancakes

Page 21: Visualising Basic Concepts of Docker
Page 22: Visualising Basic Concepts of Docker
Page 23: Visualising Basic Concepts of Docker
Page 24: Visualising Basic Concepts of Docker

Docker build -t Manifest.dockerfile

Page 25: Visualising Basic Concepts of Docker

IMAGE now built and ready to be shipped.

Page 26: Visualising Basic Concepts of Docker

Shipping = pushing image to Docker Registry

Page 27: Visualising Basic Concepts of Docker
Page 28: Visualising Basic Concepts of Docker
Page 29: Visualising Basic Concepts of Docker

Now that the Closed Container(IMAGE)

is available,What next ?

Page 30: Visualising Basic Concepts of Docker

Next : Running Multiple containers On ONE Host

Page 31: Visualising Basic Concepts of Docker

Cargo ship (Docker Host) running many containers ...

Page 32: Visualising Basic Concepts of Docker

NOTE:Ships only move in the sea

So do containers.

Page 33: Visualising Basic Concepts of Docker
Page 34: Visualising Basic Concepts of Docker

Life of a container

While running container, it may create new resources like log

files , database files etc.

Page 35: Visualising Basic Concepts of Docker

Life of a container

While running container, it may create new resources like log

files , database files etc.

Once we destroy a container, we LOSE everything.

Page 36: Visualising Basic Concepts of Docker

Life of a container - how to preserve its state ?

So, one can choose to MOUNT directories into the container .

Page 37: Visualising Basic Concepts of Docker

Life of a container - how to preserve its state ?

So, one can choose to MOUNT directories into the container.

The container can write to the mounted dir and when the

container is destroyed, its state is preserved in the mount.

We call them docker volumes

Page 38: Visualising Basic Concepts of Docker

Docker Container - Networking ?

Can i access all the ports of the container ?

Page 39: Visualising Basic Concepts of Docker

Docker Container - Networking ?

Can i access all the ports of the container ?

-> By Default No, you need to explicity expose them.

Page 40: Visualising Basic Concepts of Docker

Docker Container - Networking ?

Can i access all the ports of the container ?

-> By Default No, you need to explicitly expose PORTS.

Does it have an ip address ?

-> it does a have private IP.

Page 41: Visualising Basic Concepts of Docker
Page 42: Visualising Basic Concepts of Docker

More reading ...

https://docs.docker.com/engine/understanding-docker/

https://blog.docker.com/2016/03/containers-are-not-vms/

+ Internet ….

Page 43: Visualising Basic Concepts of Docker

Docker thank you

sweetweet213Jaihind213