How to make volumes permanent with Docker Compose v2

前端 未结 5 2087
庸人自扰
庸人自扰 2021-02-02 13:19

I realize other people have had similar questions but this uses v2 compose file format and I didn\'t find anything for that.

I want to make a very simple test a

5条回答
  •  说谎
    说谎 (楼主)
    2021-02-02 13:52

    You are using docker-compose down and if you look at the docs here

    Stop containers and remove containers, networks, volumes, and images created by up. Only containers and networks are removed by default.

    You are right, it should not remove volumes (by default). It may be a bug or you may have changed the default configuration. But I think the right command for you is docker-compose stop. I will try to make some tests with simplier cases for down command.

提交回复
热议问题