From the course: Learning Docker

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Stopping and removing the container

Stopping and removing the container - Docker Tutorial

From the course: Learning Docker

Stopping and removing the container

- [Instructor] All right, so let's run Docker PS dash A again. We have lots of containers here, but only one of them, our-server, is still running. The rest are just sitting there. By default, Docker does not stop or remove containers for you. Realistically, this can lead to a lot of cruft once you start a web server here, a database there, a message bus there, and another app elsewhere. You can have lots of containers sitting on your system that aren't doing anything but burning your battery and potentially slowing your computer down. So let's learn how to stop and remove containers to prevent this. Since our-server is still running, let's start there. Stopping this container is as easy as running Docker stop and providing the ID of the container or FD69, for example. That took a little longer than we expected. This is because Docker attempts to gracefully stop the program the container is running when you run this…

Contents