Skip to content

Commit 00fa3d3

Browse files
authored
Create README.md
1 parent d453b11 commit 00fa3d3

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Working-With-Volumes/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# UNDERSTANDING VOLUMES:
2+
3+
To make the storage persistent in docker.
4+
5+
6+
7+
* docker run -it --name busybox_1 -v /data busybox
8+
9+
// -v is used to add the volume
10+
11+
* cd data
12+
* ls
13+
* touch test.txt
14+
* exit
15+
* docker run -t --name busybox_2 busybox
16+
* ls
17+
* //Even though the image is of same image, the file is not being displayed
18+
* exit
19+
* docker rm busybox_2
20+
* docker run -it --name busybox_2 --volume-from busybox_1 busybox
21+
* ls
22+
23+
//Now the file is displayed inside the data folder.
24+
25+
26+
This is how persistent storage is created in the docker. So 2 APIs in two container communicating with each other use volumes to share the data.
27+

0 commit comments

Comments
 (0)