- Hands-On Kubernetes on Windows
- Piotr Tylenda
- 156字
- 2021-06-24 16:54:01
Removing volumes
To remove existing named or anonymous volumes using the docker volume rm command, they cannot be used in any container (even stopped ones). The standard procedure would be as follows:
docker stop <containerId>
docker rm <containerId>
docker volume rm <volumeId>
For anonymous volumes, if you use the --rm flag for the docker run command, the container will be removed on exit, along with its anonymous volumes. This flag should be used depending on the scenario – in most cases, it is useful for testing and development purposes to make cleanup easier.
During development, you may occasionally need to perform a full cleanup of all of the volumes on your Docker host, for example, if you need to free disk space. The Docker CLI provides a dedicated command that will remove any volumes that are not used in any container:
docker volume prune
Next, we will take a look at bind mounts and how they differ from volumes.
- Mastering Visual Studio 2017
- 零基礎學Visual C++第3版
- Responsive Web Design with HTML5 and CSS3
- 實戰Java程序設計
- 軟件測試項目實戰之性能測試篇
- x86匯編語言:從實模式到保護模式(第2版)
- Scala Reactive Programming
- 小程序,巧應用:微信小程序開發實戰(第2版)
- Spring MVC+MyBatis開發從入門到項目實踐(超值版)
- Qlik Sense? Cookbook
- Building Slack Bots
- SSH框架企業級應用實戰
- Visual Basic程序設計基礎
- 和孩子一起學編程:用Scratch玩Minecraft我的世界
- Building UIs with Wijmo