Return to site
DEVOPS: 'docker volume' or how to keep data between containers on/off runs 📦🐳
·
1. Creating Volumes⚙
$ docker volume create data_volume
$ docker volume create
2. Listing Volumes📃
$ docker volume ls
$ docker volume ls -f name=data
3. Inspecting Volumes🕵️♂️
$ docker volume inspect ca808e6fd82590dd0858f8f2486d3fa5bdf7523ac61d525319742e892ef56f59
4. Removing Volumes❌
$ docker volume rm data_volume
5. Pruning Volumes❌❌❌
$ docker volume prune
6. Starting a Container with a Volume🟢
$ docker run -v $(pwd):/var/opt/project bash:latest \
bash -c "ls /var/opt/project"