@@ -21,7 +21,7 @@ default, `docker image prune` only cleans up _dangling_ images. A dangling image
2121is one that is not tagged and is not referenced by any container. To remove
2222dangling images:
2323
24- ``` bash
24+ ``` console
2525$ docker image prune
2626
2727WARNING! This will remove all dangling images.
@@ -31,7 +31,7 @@ Are you sure you want to continue? [y/N] y
3131To remove all images which are not used by existing containers, use the ` -a `
3232flag:
3333
34- ``` bash
34+ ``` console
3535$ docker image prune -a
3636
3737WARNING! This will remove all images without at least one container associated to them.
@@ -45,7 +45,7 @@ You can limit which images are pruned using filtering expressions with the
4545` --filter ` flag. For example, to only consider images created more than 24
4646hours ago:
4747
48- ``` bash
48+ ``` console
4949$ docker image prune -a --filter " until=24h"
5050```
5151
@@ -62,7 +62,7 @@ exist, especially on a development system! A stopped container's writable layers
6262still take up disk space. To clean this up, you can use the `docker container
6363prune` command.
6464
65- ``` bash
65+ ``` console
6666$ docker container prune
6767
6868WARNING! This will remove all stopped containers.
@@ -76,7 +76,7 @@ By default, all stopped containers are removed. You can limit the scope using
7676the ` --filter ` flag. For instance, the following command only removes
7777stopped containers older than 24 hours:
7878
79- ``` bash
79+ ``` console
8080$ docker container prune --filter " until=24h"
8181```
8282
@@ -90,7 +90,7 @@ Volumes can be used by one or more containers, and take up space on the Docker
9090host. Volumes are never removed automatically, because to do so could destroy
9191data.
9292
93- ``` bash
93+ ``` console
9494$ docker volume prune
9595
9696WARNING! This will remove all volumes not used by at least one container.
@@ -104,7 +104,7 @@ By default, all unused volumes are removed. You can limit the scope using
104104the ` --filter ` flag. For instance, the following command only removes
105105volumes which are not labelled with the ` keep ` label:
106106
107- ``` bash
107+ ``` console
108108$ docker volume prune --filter " label!=keep"
109109```
110110
@@ -119,7 +119,7 @@ rules, bridge network devices, and routing table entries. To clean these things
119119up, you can use ` docker network prune ` to clean up networks which aren't used
120120by any containers.
121121
122- ``` bash
122+ ``` console
123123$ docker network prune
124124
125125WARNING! This will remove all networks not used by at least one container.
@@ -133,7 +133,7 @@ By default, all unused networks are removed. You can limit the scope using
133133the ` --filter ` flag. For instance, the following command only removes
134134networks older than 24 hours:
135135
136- ``` bash
136+ ``` console
137137$ docker network prune --filter " until=24h"
138138```
139139
@@ -147,7 +147,7 @@ The `docker system prune` command is a shortcut that prunes images, containers,
147147and networks. Volumes are not pruned by default, and you must specify the
148148` --volumes ` flag for ` docker system prune ` to prune volumes.
149149
150- ``` bash
150+ ``` console
151151$ docker system prune
152152
153153WARNING! This will remove:
@@ -160,7 +160,7 @@ Are you sure you want to continue? [y/N] y
160160
161161To also prune volumes, add the ` --volumes ` flag:
162162
163- ``` bash
163+ ``` console
164164$ docker system prune --volumes
165165
166166WARNING! This will remove:
0 commit comments