0% found this document useful (0 votes)
144 views45 pages

Docker and Kubernetes

The document discusses the topics of Docker and Kubernetes. It provides an agenda that includes an introduction to Docker concepts like images, containers, volumes and Dockerfiles. It also discusses pulling images from Docker Hub and running containers from images. The document then covers Kubernetes topics like introduction, features, architecture and Minikube. It aims to provide an overview of Docker and Kubernetes through presentations and demonstrations of related commands and workflows.

Uploaded by

Andre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
144 views45 pages

Docker and Kubernetes

The document discusses the topics of Docker and Kubernetes. It provides an agenda that includes an introduction to Docker concepts like images, containers, volumes and Dockerfiles. It also discusses pulling images from Docker Hub and running containers from images. The document then covers Kubernetes topics like introduction, features, architecture and Minikube. It aims to provide an overview of Docker and Kubernetes through presentations and demonstrations of related commands and workflows.

Uploaded by

Andre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 45

Presentation Topic

Unit VI - Future of Cloud Computing

Vishal Ambadas Meshram


vishal.meshram@viit.ac.in
Department of Computer Engineering

BRACT’S, Vishwakarma Institute of Information Technology, Pune-48


(An Autonomous Institute affiliated to Savitribai Phule Pune University)
(NBA and NAAC accredited, ISO 9001:2015 certified)
Contents
 Docker At Glance:
 Process simplification
 Broad support and adoption
 Architecture
 The Docker Workflow
 Docker Compose File
 Docker Volume
 Docker Storage

 Kubernetes:
 Introduction to Kubernetes
 Features of Kubernetes
 Kubernetes API
 Basic Architecture
 Minikube

Ref: Docker and Kubernetes Tutorial By Amigoscode and Techworld With Nana & https://www.youtube.com/watch?v=iqqDU2crIEQ&t=1002s
Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48
Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48 3
Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48 4
Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48 5
Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48
Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48
Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48
DOCKER INSTALLATION

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Docker Installation
• Visit https://docs.docker.com/get-docker/

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


VERIFY INSTALLATION

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Verify Docker Installation
• Open “windows command prompt”
• Type command “docker”
– It will display lot of commands

• Type command “docker – -version”


– It will display version of docker

• Now stop the docker engine

• Type command “docker ps”


– It will give an error

• Start the docker engine and again give command “docker ps”
• The output shows that your docker is installed and running properly.

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


IMAGES AND CONTAINERS

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48
Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48
PULLING NGINX IMAGE

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


How to get an image from Docker
hub:
1) Either click on “Explore” tab
2) Or search image in search bar
Open image “Nginx” and copy the
command.
Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48
Pulling NGINX Image
• Open command prompt:
– Type command “docker pull nginx”
This will pull the “NGINX” latest image on your computer.
• To list all the images give command:
– “docker images”
– This will display all docker images.

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


RUNNING CONTAINERS

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Running Containers from Image
• Running instance of image is called as “Container”.
• Lets create a container from the latest downloaded “Nginx” image.
• Open command prompt and type command:
– “docker run nginx:latest”
• This will not display anything but container is started. To check open another
command window and type command:
– “docker container ls” the other most preferred way is use the command
– “docker ps”
• To start container in detached mode, type command:
– “docker run –d nginx:latest” Now the process is no longer hanging and the container starts in detached
mode.

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


EXPOSING PORTS

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Exposing ports

Docker
HOST

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Exposing Ports
• Type a command in command prompt:
– First stop the running container using comman “docker stop Id/name of the container”

• Check whether any container is running by using command:


– “docker ps”

• To expose the port give command:


– “docker run –d –p 8080:80 nginx:latest”
– Where, -d : detached mode
– -p : port mapping 8080 -> host computer port and 80 -> container port

• Check the process ones type command “docker ps” and check port mapping.

• Open the browser and type “localhost:8080”


• And now stop the container and check ones again in the browser.

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


EXPOSING MULTIPLE PORTS

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Exposing multiple ports

Docker
HOST

To expose the multiple ports give command:


“docker run –d –p 8080:80 –p 3000:80 nginx:latest”

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


MANAGING CONTAINERS

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Managing Containers
• How to start, stop, remove, name containers.

1) Stop containers:
- docker ps (lists the running containers)
- docker stop container Id/ Name

2) Start containers:
- docker ps (lists the running containers)
- docker start container Id/ Name
- Command to know all containers running and stopped is
- docker ps –a

3) Remove containers:
- docker ps -a (lists the running containers)
- docker rm container Id/ Name
- Docker rmi imageid/name

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Managing Containers
• How to start, stop, remove containers.

4) Naming containers:
- Docker gives random names to containers if you doesn’t specify it.
- You must give names to container when you create your own container.
- use following command to give names to container:

- Docker run –name website –d –p 8080:80 –p 3000:80 nginx:latest


- Docker ps (To check name of container)

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


VOLUMES

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48
Volumes

80

Docker
HOST

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


VOLUMES BETWEEN HOST &
CONTAINER
Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48
Volumes between Host & Container

Docker
HOST

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Volumes between Host & Container
Steps:
1) Create a “website” folder on Desktop.
2) Create a file name ”index.html” and write a code:
<h1> My name is Bond. James Bond..007 </h1>
3) Stop and remove all running container.
4) Open command prompt and navigate to directory “website” and give following commands:
/website> ls -> you must able to see index.html
/website> docker run –name website –v %CD%:/usr/share/nginx/html -d –p 8080:80
–p 3000:80 nginx:latest
5) Open a web browser and check “localhost:8080” and you will get an output of
“My name is bond. James Bond. 007”
6) You can check the folders In container:
/website> docker exec –it website bash
and now you are in container..
7) Create a folder in website and you will find it in the host website folder.

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


CUSTOMIZE WEBSITE

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Customize Website
Steps:
1) Open Google search and type “Bootstrap Single Page Template”.
2) Open first site, select any template download code and copy it in the “website” folder
3) Open a web browser and check “localhost:8080” and you will get an output of
very nice website.

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


VOLUMES (BETWEEN CONTAINER)

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Volumes (Between Container)

Docker
HOST

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Volumes (between Container)
Steps:
1) Open command prompt and give command:
• Docker run –help
2) Open command prompt and navigate to directory “website” and give following commands:
/website> docker run –name website-copy –volumes-from website -d –p 8081:80
nginx:latest
• Here we use command –volumes-from
3) Open web browser and check:
• Localhost:8080
• Loclahost:8081

You will get the same website

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


DOCKERFILE

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Dockerfile

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Dockerfile
Visit website: https://docs.docker.com/engine/reference/builder/

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


CREATING DOCKERFILE

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Creating Dockerfile
Visit website: https://docs.docker.com/engine/reference/builder/

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48


Thank You

Vishal A. Meshram, Department of Computer Engineering, VIIT, Pune-48 45

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy