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 in Docker by Vish
22 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 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 by Sirajul
• 16,640 points

Related Questions In Docker

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
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
• 6,900 points
270 views
0 votes
1 answer
0 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
• 56,200 points
128 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
• 9,530 points
30 views
0 votes
1 answer

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

Here is very basic explanation for image ...READ MORE

answered Sep 4, 2018 in Docker by Damon Salvatore
• 5,510 points
513 views