From the course: Docker for Developers: Create and Manage Docker Containers

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Removing containers

Removing containers

- [Narrator] It's easy to build up a collection of old containers with Docker. Some might be stopped, others unused. Clearing them out can help clean your system and avoid confusion. Let's walk through how to remove Docker containers using the CLI, VS Code, and Docker Desktop. First, we'll use the CLI. We need the container ID or name. In a terminal type docker ps and the a flag to display both running and stopped containers. You should still have a container running from the previous video. We need to stop the running container before we remove it. Type docker stop, and then the container ID or name. To remove the container completely, type docker rm, and then the container ID or name. You can also use the command docker container prune to remove all stopped containers. This command will not affect running containers. It's a good practice to run this command regularly to keep your system clean. The Container Tools VS…

Contents