官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 桑植县| 林甸县| 合江县| 微博| 峨山| 西平县| 页游| 喀什市| 菏泽市| 张掖市| 电白县| 东兴市| 宁河县| 莱芜市| 电白县| 习水县| 湾仔区| 芜湖市| 达拉特旗| 福鼎市| 龙海市| 文安县| 天镇县| 开原市| 体育| 宕昌县| 东至县| 广饶县| 东山县| 宜宾市| 鄂伦春自治旗| 卓资县| 永宁县| 漠河县| 高要市| 永兴县| 元谋县| 高雄县| 扶余县| 东山县| 承德县|