DOCKER

Download as pdf or txt
Download as pdf or txt
You are on page 1of 94

Continuous Deployment: Containerization

with Docker
Contents DevOps Lab

✓ The Metrix from Hell


✓ What is Containerization/Docker?
✓ Docker Architecture
✓ Docker Installation
✓ Docker Images
✓ Docker Containers
✓ Docker Hub
✓ Docker Basic Commands
✓ Docker File
✓DEMO IN VM
✓DEMO IN AWS CONSOLE
2
DevOps Lab

3
DevOps Lab

4
DevOps Lab

5
DevOps Lab

6
DevOps Lab

7
DevOps Lab

8
DevOps Lab

9
DevOps Lab

10
DevOps Lab

11
DevOps Lab

12
DevOps Lab

15
DevOps Lab

16
DevOps Lab

17
DevOps Lab
Virtual Machine Vs Docker

18
DevOps Lab

19
DevOps Lab

20
DevOps Lab

21
DevOps Lab

22
DevOps Lab

23
DevOps Lab

24
Virtual Machine VsLabDocker
DevOps

25
DevOps Lab
TRIVIA!!!!!
Suppose I have a system with only 4 GB of RAM and I want to run 4 instances of a
particular DevOps tool, then which of the below is the best choice?

A. 4 VMs with 4 different instances of that tool.

B. 1 VM with 4 different instances of that tool.

C. 4 Docker Containers with different instances of that tool.

26
DevOps Lab
TRIVIA!!!!!
Suppose I have a system with only 4 GB of RAM and I want to run 4 instances of a
particular DevOps tool, then which of the below is the best choice?

A. 4 VMs with 4 different instances of that tool.

B. 1 VM with 4 different instances of that tool.

C. 4 Docker Containers with different instances of that tool.


✓Docker Containers will utilize lesser RAM compared to VMs.

✓VMs caannot be used here, as each VM requires 1 GB of RAM and we do not


have that much resource. But, in Docker there is no need to pre-allocate RAM.

27
DevOps Lab
Virtual Machine Vs Docker

28
DevOps Lab
Virtual Machine Vs Docker

29
DevOps Lab
Virtual Machine Vs Docker

30
DevOps Lab
Virtual Machine Vs Docker

31
DevOps Lab

32
DevOps Lab

33
DevOps Lab

34
TRIVIA!!!!! DevOps Lab

Which of the following option(s) is correct w.r.t to creating Docker


Containers?

A. I can build my own Image and use it for creating a Docker


Container.

B. I can pull an Image from Docker Hub and then run the Docker
Image.

C. I can directly create a Docker Container without Docker Image

35
TRIVIA!!!!! DevOps Lab

Which of the following option(s) is correct w.r.t to creating Docker


Containers?

A. I can build my own Image and use it for creating a Docker


Container.

B. I can pull an Image from Docker Hub and then run the Docker
Image.

C. I can directly create a Docker Container without Docker Image


Docker Containers are created by executing the Docker Image. Hence it is not possible
to run a container without building the Image.

36
TRIVIA!!!!! DevOps Lab

Where does the Docker Daemon store the Docker Images ?

A. Docker Client

B. Docker Host.

C. Docker Registry

37
TRIVIA!!!!! DevOps Lab

Where does the Docker Daemon store the Docker Images ?

A. Docker Client

B. Docker Host.

C. Docker Registry

All the Docker Images are stored in the Docker Registry which can be either a local
repository or a remote Docker Hub.

38
DevOps Lab

39
Docker Hub DevOps Lab https://hub.docker.com/

40
Docker Hub DevOps Lab

41
Practical Demonstration
DevOps Lab

1) Docker Installation

2) Basic Docker Commands

3) To Build, deploy and manage Web Application on Docker


Engine

4) Publishing image on Docker Hub

5) Create and implement docker images using Dockerfile.

42
Dockerfile DevOps Lab

43
Dockerfile DevOps Lab

44
STEPS to Follow
DevOps For
Lab Dockerfile

45
Practical Demonstration
DevOps Lab

46
Practical Demonstration
DevOps Lab

47
Practical Demonstration
DevOps Lab

48
Practical Demonstration
DevOps Lab

49
Practical Demonstration
DevOps Lab

50
Practical Demonstration
DevOps Lab

51
Practical Demonstration
DevOps Lab

52
Practical Demonstration-
DevOps Lab Dockerfile
root@sujata-laptop:/home/devasc/Desktop# mkdir DockerNginx

# cd DockerNginx/
#ls
# nano Dockerfile

FROM nginx
MAINTAINER Sujata Oak
COPY index.html /usr/share/nginx/html

#nano index.html
HTML Calculator

root@sujata-laptop:/home/devasc/Desktop/DockerNginx# docker build -t webser:v1 .

root@sujata-laptop:/home/devasc/Desktop/DockerNginx# docker images

53
Practical Demonstration-
DevOps Lab Dockerfile
root@sujata-laptop:/home/devasc/Desktop/DockerNginx# docker run -itd -p 1234:80
webser:v1

docker ps -a

docker stop bf5

docker start bf5

http://localhost:1234/

54
Practical Demonstration
DevOps Lab

To Delete All Container:


#docker rm <containerid1> <containerid2>……

If Suppose the list of containers are huge might be 100 container, So


how to delete all 100 containers at one go:
#docker rm $(docker ps –aq)

To Delete Images: Since Images stackup space in your local machine.


#docker rmi <imagename/imageid>

NOTE: You cannot delete images, if container is running.

55
How Does Docker
DevOps Lab
Work?

56
DevOps Lab

57
ComponentsDevOps
of Docker
Lab

58
Docker ClientDevOps
andLabServer

59
Docker ClientDevOps
andLabServer

60
Syllabus Scheme

61
Syllabus Scheme

62
Syllabus Scheme

63
Syllabus Scheme

64
Syllabus Scheme

65
Syllabus Scheme

66
Syllabus Scheme

67
Syllabus Scheme

68
Syllabus Scheme

69
Syllabus Scheme

70
REFERENCES

https://www.javatpoint.com/docker-dockerfile

Installation tutorial :
https://www.youtube.com/watch?v=fqMOX6JJhGo
Docker commands labs:
https://kodekloud.com/p/docker-labs

Docker notes:
Lab 1 - Docker Basic Commands Click here to access Labs | Kode Kloud Use volumes |
Docker
Documentation
Docker Tutorial Series — Part 3 — More on Images and Containers
How To Share Data between Docker Containers | DigitalOcean Docker Volumes

71
REFERENCES

How To Share Data Between the Docker Container and the Host | DigitalOcean
Dockerfile Tutorial | Create Docker Image using Dockerfile | GeekFlare
Docker Tutorial Series : Writing a Dockerfile - Romin Irani’s Blog
Docker Tutorial Series - Romin Irani’s Blog
Dockerfile tutorial done :
https://training.play-with-docker.com/ops-s1-images/

Docker volumes - networking - website hosting and nodejs hosting


https://www.katacoda.com/courses/docker

72
REFERENCES

73
REFERENCES

74
REFERENCES

75
REFERENCES

76
REFERENCES

77
REFERENCES

78
REFERENCES

79
REFERENCES

80
REFERENCES

81
REFERENCES

82
REFERENCES

83
REFERENCES

84
REFERENCES

85
REFERENCES

86
REFERENCES

87
REFERENCES

88
REFERENCES

89
REFERENCES

90
REFERENCES

91
REFERENCES

92
REFERENCES

93
REFERENCES

94
REFERENCES

To delete all containers including its volumes use,

docker rm -vf $(docker ps -aq)


To delete all the images,

docker rmi -f $(docker images -aq)

95
Syllabus Scheme

96

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