Difference between revisions of "Docker system prune"

From wikieduonline
Jump to navigation Jump to search
(Created page with "<pre> docker system prune -a WARNING! This will remove: - all stopped containers - all networks not used by at least one container - all images without...")
 
Tags: Mobile web edit, Mobile edit
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
https://docs.docker.com/engine/reference/commandline/system_prune/. Since API 1.25+ (v 1.13) 01/2017 [https://www.docker.com/blog/whats-new-in-docker-1-13/ announcement]
 +
 +
 +
Use carefully, your stopped containers will be deleted.
 +
 +
* <code>[[docker system]] prune</code>
 +
* <code>[[docker system]] prune -a</code>
 +
* <code>[[docker system]] prune -f</code> (<code>-f</code>Do not ask for confirmation)
 +
 +
* <code>[[docker system prune --volumes]]</code>
 +
 +
docker system prune --all --volumes --force
 +
 +
 +
<code>docker system prune</code>
 +
WARNING! This will remove:
 +
  - all stopped containers
 +
  - all networks not used by at least one container
 +
  - all dangling images
 +
  - all dangling build cache
 +
 +
<code>docker system prune -a</code> Remove all unused images not just [[dangling]] (untagged) ones
 
<pre>
 
<pre>
 
docker system prune -a
 
docker system prune -a
Line 7: Line 29:
 
         - all build cache
 
         - all build cache
 
Are you sure you want to continue? [y/N] y
 
Are you sure you want to continue? [y/N] y
Total reclaimed space: 0B
+
 
 +
..../....
 +
 
 +
Total reclaimed space: 301MB
 
</pre>
 
</pre>
 +
 +
* <code>[[docker system prune --volumes]]</code> (Related [[Docker Volumes]]: <code>[[docker volumes prune]]</code>)
 +
<code>[[docker volume ls]]</code>
 +
 +
 +
[[journalctl -r -u dockerd]]
 +
Sep 15 15:49:41 SERVER_NAME dockerd[1015]: time="2020-09-15T15:49:41.387495853+04:00" level=warning msg="failed to prune image docker.io .../... No such image:
 +
 +
 +
== Related commands ==
 +
* <code>[[docker system df]]</code> or <code>[[docker system df]] --verbose</code>
 +
* <code>[[docker image prune]]</code>
 +
* <code>[[docker network ls]]</code>
 +
* <code>[[docker volume ls]]</code>
 +
* <code>[[docker image ls]]</code>
 +
* <code>[[docker network prune]]</code>
 +
* <code>[[docker volume prune]]</code>
 +
 +
== Activities ==
 +
* Read deletes docker [[roadmap]] statements: https://github.com/docker/distribution/blob/master/ROADMAP.md#deletes
 +
 +
== See also ==
 +
* {{du}}
 +
* {{docker system}}
 +
* {{docker}}
 +
 +
 +
 +
[[Category:docker]]

Revision as of 12:12, 11 April 2021

https://docs.docker.com/engine/reference/commandline/system_prune/. Since API 1.25+ (v 1.13) 01/2017 announcement


Use carefully, your stopped containers will be deleted.

docker system prune --all --volumes --force


docker system prune

WARNING! This will remove:
 - all stopped containers
 - all networks not used by at least one container
 - all dangling images
 - all dangling build cache

docker system prune -a Remove all unused images not just dangling (untagged) ones

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

..../....

Total reclaimed space: 301MB
docker volume ls


journalctl -r -u dockerd
Sep 15 15:49:41 SERVER_NAME dockerd[1015]: time="2020-09-15T15:49:41.387495853+04:00" level=warning msg="failed to prune image docker.io .../... No such image:


Related commands

Activities

See also

  • https://docs.docker.com/v17.12/edge/engine/reference/commandline/system_info/
  • https://docs.docker.com/v17.12/edge/engine/reference/commandline/system_events/
  • Advertising: