问题原文
原帖链接 · Derek Mahar · CC BY-SA 3.0
How can I prevent docker-compose up from copying saved volumes from the previous session into a container? In effect, I want Docker Compose to behave like docker run which discards the contents of private volumes when its container exits.
已采纳解答
原帖链接 · Derek Mahar · CC BY-SA 3.0
It seems that no option exists to prevent docker-compose up from using volumes from a previous session. The best alternative I could think of is to stop the containers and then remove the containers and their private volumes:
docker-compose stop
docker-compose rm -fv
Note that unlike docker-compose down --volumes, this preserves named volumes.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
