From the course: Learning Docker
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Exploring the Docker CLI3m 1s
-
(Locked)
Create a Docker container6m 58s
-
(Locked)
Create a Docker container: The short way2m 9s
-
(Locked)
Create a Docker container from Dockerfiles, part 12m 46s
-
(Locked)
Create a Docker container from Dockerfiles, part 22m 37s
-
(Locked)
Interact with your container5m 9s
-
(Locked)
Stopping and removing the container5m 41s
-
(Locked)
Binding ports to your container4m 36s
-
(Locked)
Saving data from containers5m 39s
-
(Locked)
Introducing the Docker Hub1m 23s
-
(Locked)
Pushing images to the Docker registry3m 13s
-
(Locked)
Checking your images in Docker Hub2m 44s
-
(Locked)
Challenge: Starting NGINX1m 16s
-
(Locked)
Solution: Starting NGINX5m 18s
-
-
-
-