What is docker system prune is used for

0 votes

I have recently started studying Docker and I came across the following command:

$ docker system prune

What is it used for?

Jul 30, 2019 in Docker by Vish
23,960 views

2 answers to this question.

0 votes

The above command is used to remove all the stopped containers, all the networks that are not used, all dangling images and all build caches. It’s one of the most useful docker commands.

Have a look at this for detailed info: https://docs.docker.com/engine/reference/commandline/system_prune/

answered Jul 30, 2019 by Kavya
0 votes

The basic usage of the command docker system prune is Remove unused data.

Removes all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes.

Example:

$ docker system prune

WARNING! This will remove:
        - all stopped containers
        - all networks not used by at least one container
        - all dangling images
        - all build cache
Are you sure you want to continue? [y/N] y

Deleted Containers:
f44f9b81948b3919590d5f79a680d8378f1139b41952e219830a33027c80c867
792776e68ac9d75bce4092bc1b5cc17b779bc926ab04f4185aec9bf1c0d4641f

Deleted Networks:
network1
network2

Deleted Images:
untagged: hello-world@sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f
deleted: sha256:1815c82652c03bfd8644afda26fb184f2ed891d921b20a0703b46768f9755c57
deleted: sha256:45761469c965421a92a69cc50e92c01e0cfa94fe026cdd1233445ea00e96289a

Total reclaimed space: 1.84kB

answered Aug 5, 2019 by Sirajul
• 59,230 points

Related Questions In Docker

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

What is the process for stopping and restarting a docker container?

If you want to stop a docker ...READ MORE

answered Jul 3, 2019 in Docker by Sirajul
• 59,230 points
8,799 views
0 votes
1 answer

What is the difference between “expose” and “publish” in Docker?

Basically, you have three options: Neither specify EXPOSE nor -p -> ...READ MORE

answered Jul 18, 2018 in Docker by Nilesh
• 7,050 points
3,054 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,090 points
2,435 views
+1 vote
1 answer

What is the default amount of memory provided for Windows Docker containers?

Docker for Windows containers by default get: On ...READ MORE

answered Oct 25, 2018 in Docker by Sophie may
• 10,610 points
521 views
0 votes
3 answers

What is the difference between a Docker image and a container?

Images are read-only templates that contain a ...READ MORE

answered Aug 10, 2020 in Docker by Vishal
• 260 points
6,110 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP