Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to stop Docker deleting containers every time Visual Studio is closed on my Windows PC?

I have created an app, which uses Docker to create containers. The app takes about 20-30 minutes to build the first time and then it is very quick thereafter.

On my MAC; containers are kept until they are deleted by me. However, on my Windows PC; the containers are automatically deleted every time I close Visual Studio 2017. Therefore I have to sit and wait for my solution to build each time I open the solution fresh on my Windows PC.

Is there a way to stop Docker deleting containers every time Visual Studio is closed on my Windows PC?

So far I have looked for a setting inside Docker desktop and inside Visual Studio/Options, however I cannot find it. I have also Googled this.

like image 895
w0051977 Avatar asked Sep 06 '25 05:09

w0051977


1 Answers

In Visual Studio 2019, under Tools->Options search for Docker Compose and then set the Remove containers on project close option to False. Click OK and you should be good.

Option to change

like image 157
Aleksandar Djurdjev Avatar answered Sep 09 '25 17:09

Aleksandar Djurdjev