Professional Documents
Culture Documents
*************
Data available even though container got deleted
Volume Mount
************
Bind Mount
**********
docker volume ls
Creating a Volume
*****************
docker volume create --name customerdb
docker volume ls
Use Case 1: Creating a container with volume and remove the container once you exit
from the container
***********************************************************************************
*******************
Output is
Get into platniumcustomer folder and add few files under this folder
exit
docker ps
and
docker ps -a
You can get output of Json format and refer Mount Point Path
Go to Mount Point path where you get the file which you created inside the
container
Lesson Learned: Even if you deleted container, data can be alive at base machine
***********************************************************************************
*******************
Old container deleted, but container data stored in the Host machine volume
***********************************************************************************
********************
(Now whatever data I captured here that persists to host machine too and if I
remove the container,
the same data persists to host machine)
Now container alive now since we did not use --rm command
***********************************************************************************
********************
Apply
or
Get into container os and you go respective foler where you can get respective
files
***********************************************************************************
*******************
***********************************************************************************
********************
Use Case 8 : Create suse7 container and mount volumes from suse6
****************************************************************
***********************************************************************************
*******************
Use Case 9: Bind Volume
***********************
After exit from the container, at host system you can get data which created at
container
At host system, edit the files (Whatever you edited which can be available at
container too)