How to make volumes permanent with Docker Compose v2

前端 未结 5 2088
庸人自扰
庸人自扰 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:57

    Not sure if this helps or not. When you use docker-compose up -d the container is downloaded and images created. To stop the docker images, use docker-compose down, and the images will remain and can be restarted with docker-compose start

    I was using the up/down commands and kept losing my data until I tried the stop/start and now data persists.

提交回复
热议问题