2016-10-14 18:30:36 -04:00
|
|
|
---
|
|
|
|
title: "system df"
|
|
|
|
description: "The system df command description and usage"
|
2016-11-03 18:48:30 -04:00
|
|
|
keywords: "system, data, usage, disk"
|
2016-10-14 18:30:36 -04:00
|
|
|
---
|
2016-08-31 12:57:32 -04:00
|
|
|
|
|
|
|
# system df
|
|
|
|
|
|
|
|
```markdown
|
2020-10-02 09:51:01 -04:00
|
|
|
Usage: docker system df [OPTIONS]
|
2016-08-31 12:57:32 -04:00
|
|
|
|
|
|
|
Show docker filesystem usage
|
|
|
|
|
|
|
|
Options:
|
2017-04-27 04:26:04 -04:00
|
|
|
--format string Pretty-print images using a Go template
|
|
|
|
--help Print usage
|
|
|
|
-v, --verbose Show detailed information on space usage
|
2016-08-31 12:57:32 -04:00
|
|
|
```
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
## Description
|
|
|
|
|
2016-08-31 12:57:32 -04:00
|
|
|
The `docker system df` command displays information regarding the
|
|
|
|
amount of disk space used by the docker daemon.
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
## Examples
|
|
|
|
|
2016-08-31 12:57:32 -04:00
|
|
|
By default the command will just show a summary of the data used:
|
2017-02-07 18:42:48 -05:00
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2016-08-31 12:57:32 -04:00
|
|
|
$ docker system df
|
2017-02-07 18:42:48 -05:00
|
|
|
|
2016-08-31 12:57:32 -04:00
|
|
|
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
|
|
|
|
Images 5 2 16.43 MB 11.63 MB (70%)
|
|
|
|
Containers 2 0 212 B 212 B (100%)
|
|
|
|
Local Volumes 2 1 36 B 0 B (0%)
|
|
|
|
```
|
|
|
|
|
|
|
|
A more detailed view can be requested using the `-v, --verbose` flag:
|
2017-02-07 18:42:48 -05:00
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2016-08-31 12:57:32 -04:00
|
|
|
$ docker system df -v
|
2017-02-07 18:42:48 -05:00
|
|
|
|
2016-08-31 12:57:32 -04:00
|
|
|
Images space usage:
|
|
|
|
|
|
|
|
REPOSITORY TAG IMAGE ID CREATED SIZE SHARED SIZE UNIQUE SIZE CONTAINERS
|
|
|
|
my-curl latest b2789dd875bf 6 minutes ago 11 MB 11 MB 5 B 0
|
|
|
|
my-jq latest ae67841be6d0 6 minutes ago 9.623 MB 8.991 MB 632.1 kB 0
|
|
|
|
<none> <none> a0971c4015c1 6 minutes ago 11 MB 11 MB 0 B 0
|
|
|
|
alpine latest 4e38e38c8ce0 9 weeks ago 4.799 MB 0 B 4.799 MB 1
|
|
|
|
alpine 3.3 47cf20d8c26c 9 weeks ago 4.797 MB 4.797 MB 0 B 1
|
|
|
|
|
|
|
|
Containers space usage:
|
|
|
|
|
|
|
|
CONTAINER ID IMAGE COMMAND LOCAL VOLUMES SIZE CREATED STATUS NAMES
|
|
|
|
4a7f7eebae0f alpine:latest "sh" 1 0 B 16 minutes ago Exited (0) 5 minutes ago hopeful_yalow
|
|
|
|
f98f9c2aa1ea alpine:3.3 "sh" 1 212 B 16 minutes ago Exited (0) 48 seconds ago anon-vol
|
|
|
|
|
|
|
|
Local Volumes space usage:
|
|
|
|
|
|
|
|
NAME LINKS SIZE
|
|
|
|
07c7bdf3e34ab76d921894c2b834f073721fccfbbcba792aa7648e3a7a664c2e 2 36 B
|
|
|
|
my-named-vol 0 0 B
|
|
|
|
```
|
|
|
|
|
|
|
|
* `SHARED SIZE` is the amount of space that an image shares with another one (i.e. their common data)
|
|
|
|
* `UNIQUE SIZE` is the amount of space that is only used by a given image
|
|
|
|
* `SIZE` is the virtual size of the image, it is the sum of `SHARED SIZE` and `UNIQUE SIZE`
|
|
|
|
|
2020-04-19 09:43:08 -04:00
|
|
|
> **Note**
|
|
|
|
>
|
|
|
|
> Network information is not shown because it does not consume disk space.
|
2016-10-18 00:36:52 -04:00
|
|
|
|
2017-03-21 12:10:31 -04:00
|
|
|
## Performance
|
|
|
|
|
|
|
|
The `system df` command can be very resource-intensive. It traverses the
|
|
|
|
filesystem of every image, container, and volume in the system. You should be
|
|
|
|
careful running this command in systems with lots of images, containers, or
|
|
|
|
volumes or in systems where some images, containers, or volumes have very large
|
|
|
|
filesystems with many files. You should also be careful not to run this command
|
|
|
|
in systems where performance is critical.
|
|
|
|
|
2017-03-02 07:05:48 -05:00
|
|
|
## Format the output
|
|
|
|
|
|
|
|
The formatting option (`--format`) pretty prints the disk usage output
|
|
|
|
using a Go template.
|
|
|
|
|
|
|
|
Valid placeholders for the Go template are listed below:
|
|
|
|
|
|
|
|
| Placeholder | Description |
|
|
|
|
| -------------- | ------------------------------------------ |
|
|
|
|
| `.Type` | `Images`, `Containers` and `Local Volumes` |
|
|
|
|
| `.TotalCount` | Total number of items |
|
|
|
|
| `.Active` | Number of active items |
|
|
|
|
| `.Size` | Available size |
|
|
|
|
| `.Reclaimable` | Reclaimable size |
|
|
|
|
|
|
|
|
When using the `--format` option, the `system df` command outputs
|
|
|
|
the data exactly as the template declares or, when using the
|
|
|
|
`table` directive, will include column headers as well.
|
|
|
|
|
|
|
|
The following example uses a template without headers and outputs the
|
2020-04-19 11:23:09 -04:00
|
|
|
`Type` and `TotalCount` entries separated by a colon (`:`):
|
2017-03-02 07:05:48 -05:00
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2017-03-02 07:05:48 -05:00
|
|
|
$ docker system df --format "{{.Type}}: {{.TotalCount}}"
|
|
|
|
|
|
|
|
Images: 2
|
|
|
|
Containers: 4
|
|
|
|
Local Volumes: 1
|
|
|
|
```
|
|
|
|
|
|
|
|
To list the disk usage with size and reclaimable size in a table format you
|
|
|
|
can use:
|
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2017-03-02 07:05:48 -05:00
|
|
|
$ docker system df --format "table {{.Type}}\t{{.Size}}\t{{.Reclaimable}}"
|
|
|
|
|
|
|
|
TYPE SIZE RECLAIMABLE
|
|
|
|
Images 2.547 GB 2.342 GB (91%)
|
|
|
|
Containers 0 B 0 B
|
|
|
|
Local Volumes 150.3 MB 150.3 MB (100%)
|
|
|
|
<Paste>
|
|
|
|
```
|
|
|
|
|
|
|
|
**Note** the format option is meaningless when verbose is true.
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
## Related commands
|
2016-08-31 12:57:32 -04:00
|
|
|
* [system prune](system_prune.md)
|
|
|
|
* [container prune](container_prune.md)
|
|
|
|
* [volume prune](volume_prune.md)
|
|
|
|
* [image prune](image_prune.md)
|
2016-10-18 00:36:52 -04:00
|
|
|
* [network prune](network_prune.md)
|