-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathDay 16_Docker Volumes_Part 1.txt
69 lines (40 loc) · 2.58 KB
/
Day 16_Docker Volumes_Part 1.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
DOCKER - Basics to Brilliance
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
***************
DAY 16
***************
Docker Volumes
-----------------------------
=> Docker volume is a storage mechanism that allows the data to persist beyond the lifecyle of a docker container.
=> Docker container --- Netflix --- Delete Docker container ---- App will also get deleted.
=> EC2 Instance --- index.html --- EBS
=> DV are meant for data storage
=> DV are used to share the data b/w container or to retain the data when containers are stopped/restarted/removed
Types of Docker Volumes:
1. Named Volumes
1.1. Managed by docker. These are stored in a default location on the host. We can also share the data b/w the containers
2. Anonymous Volumes
2.1. Created by docker when no name is provided. They can be difficult to manage because they lack identification.
3. Bind Mounts
3.1. Link a directory or a file that is available on a host machine to a location inside the container
=> DV are used to persist the data generated by the docker container
=> Using DV we can de-couple data storage from docker containers
=> Using DV we can share the data among multiple containers
=> On deletion of docker container, docker volumes will not get deleted
=> We can create morethan 1 volume inside a single container
=> One volume can be attached to multiple containers, but at a time we can attach only one volume to one container
-------------------------------------
Docker Volume Commands
-------------------------------------
1. docker volume --help ---> To see the commands related to the docker volume
2. docker volume ls ---> To see the local docker volume
3. docker volume <Volume-Name> ---> To create a docker volume
4. docker volume inspect <Volume-Name> ---> To see the metadata of a volume
5. docker volume rm <Volume-Name> ---> To remove the docker volume
6. docker volume prune ---> To remove all the unused volumes
****************************************************************************************************************************
By
KASTRO KIRAN V
Connect with me on LinkedIn: https://www.linkedin.com/in/kastro-kiran/
If interested, Join the WhatsApp group for technical discussions: https://chat.whatsapp.com/EGw6ZlwUHZc82cA0vXFnwm
****************************************************************************************************************************