beginners/volume/creating-volume-mount-from-dockercli.md
$ docker rm -f $(docker ps -a -q)
$ docker volume rm $(docker volume ls -q)
The Task for this lab is to create a volume, call it my_volume.
you should than run a simple an thin container and attach a volume to it. use the image selaworkshops/busybox:latest and use any name to the mounted volume directory (e.g : data)
change something in the volume folder , e.g : add a file with some content.
create a second volume mounted to the same volume , make sure the file you created in step 3 exists !
$ docker volume ls
$ docker volume create my-volume
$ docker volume inspect my-volume
[
{
"CreatedAt": "2018-06-13T20:36:15Z",
"Driver": "local",
"Labels": {},
"Mountpoint": "/var/lib/docker/volumes/my-volume/_data",
"Name": "my-volume",
"Options": {},
"Scope": "local"
}
]
$ docker run -it -v my-volume:/data --name my-container selaworkshops/busybox:latest
$ cd /data
$ echo "hello" > hello.txt
$ ls
$ docker run -it -v my-volume:/data --name my-container-2 selaworkshops/busybox:latest
$ cd data
$ ls
$ exit
$ docker rm -f my-container my-container-2
$ docker ps -a
$ docker run -it -v my-volume:/data --name new-container selaworkshops/busybox:latest
$ cd data
$ ls
$ exit
$ docker rm -f new-container
Next >> The docker network Command