question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] How to stop the Docker containers from Visual Studio 2017?

See original GitHub issue

Hello,

How to stop the containers that was run by Docker Compose? I click “Stop Debug” (Shift + F5) from Visual Studio 2017 but the containers are still running. Also tried docker-compose stop to no avail.

I have tried “Build -> Clean Solution” but I don’t want to clean everything.

Thanks.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
CESARDELATORREcommented, Jan 25, 2019

Afaik, the only way to do it from VS would be to do a “Clean Solution”. Other choices:

  • From docker CLI
  • Restarting Docker, which is worse (needs more time)
1reaction
mvelosopcommented, Feb 21, 2019

Hi @chess-equality,

There’s no way to do that that I’m aware of, but you can do it from the command line with this command:

docker container stop $(docker container ls -a -q)

You can also create a container with Portainer with this batch and keep it on the desktop 😉

docker start portainer
if errorlevel 1 docker run -d -p 9000:9000 -v "/var/run/docker.sock:/var/run/docker.sock" --name portainer portainer/portainer --no-auth
rem wait for 5 seconds
ping 127.0.0.1 -n 5 > nul
start http://localhost:9000

Hope this helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to stop VS2017 preparing the docker images
The solution is by disabling it under. Tools->Options menu and then Container Tools->Settings.
Read more >
Closing Solution or Visual Studio is not Stopping Docker- ...
After closing a solution, I can see in the Container Tools window that docker-compose is never called to tear down the containers.
Read more >
Inspecting Docker Containers with Visual Studio Code
Now from the terminal/command prompt, run docker-compose down to stop the running container. This will free up memory and release any used ports ......
Read more >
Install Build Tools into a container - Visual Studio
In your Dockerfile file, remove the C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat and && parameters from the ENTRYPOINT command. The command ...
Read more >
Tip 60 - Use Visual Studio 2017 with Docker Support
NET Core WebAPI project · Add it to a Docker Container using Docker Compose and push it to a ... Open Visual Studio...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found