github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/docs/reference/commandline/system_df.md (about)

     1  ---
     2  title: "system df"
     3  description: "The system df command description and usage"
     4  keywords: "system, data, usage, disk"
     5  ---
     6  
     7  # system df
     8  
     9  ```markdown
    10  Usage:  docker system df [OPTIONS]
    11  
    12  Show docker filesystem usage
    13  
    14  Options:
    15        --format string   Pretty-print images using a Go template
    16        --help            Print usage
    17    -v, --verbose         Show detailed information on space usage
    18  ```
    19  
    20  ## Description
    21  
    22  The `docker system df` command displays information regarding the
    23  amount of disk space used by the docker daemon.
    24  
    25  ## Examples
    26  
    27  By default the command will just show a summary of the data used:
    28  
    29  ```bash
    30  $ docker system df
    31  
    32  TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
    33  Images              5                   2                   16.43 MB            11.63 MB (70%)
    34  Containers          2                   0                   212 B               212 B (100%)
    35  Local Volumes       2                   1                   36 B                0 B (0%)
    36  ```
    37  
    38  A more detailed view can be requested using the `-v, --verbose` flag:
    39  
    40  ```bash
    41  $ docker system df -v
    42  
    43  Images space usage:
    44  
    45  REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE                SHARED SIZE         UNIQUE SIZE         CONTAINERS
    46  my-curl             latest              b2789dd875bf        6 minutes ago       11 MB               11 MB               5 B                 0
    47  my-jq               latest              ae67841be6d0        6 minutes ago       9.623 MB            8.991 MB            632.1 kB            0
    48  <none>              <none>              a0971c4015c1        6 minutes ago       11 MB               11 MB               0 B                 0
    49  alpine              latest              4e38e38c8ce0        9 weeks ago         4.799 MB            0 B                 4.799 MB            1
    50  alpine              3.3                 47cf20d8c26c        9 weeks ago         4.797 MB            4.797 MB            0 B                 1
    51  
    52  Containers space usage:
    53  
    54  CONTAINER ID        IMAGE               COMMAND             LOCAL VOLUMES       SIZE                CREATED             STATUS                      NAMES
    55  4a7f7eebae0f        alpine:latest       "sh"                1                   0 B                 16 minutes ago      Exited (0) 5 minutes ago    hopeful_yalow
    56  f98f9c2aa1ea        alpine:3.3          "sh"                1                   212 B               16 minutes ago      Exited (0) 48 seconds ago   anon-vol
    57  
    58  Local Volumes space usage:
    59  
    60  NAME                                                               LINKS               SIZE
    61  07c7bdf3e34ab76d921894c2b834f073721fccfbbcba792aa7648e3a7a664c2e   2                   36 B
    62  my-named-vol                                                       0                   0 B
    63  ```
    64  
    65  * `SHARED SIZE` is the amount of space that an image shares with another one (i.e. their common data)
    66  * `UNIQUE SIZE` is the amount of space that is only used by a given image
    67  * `SIZE` is the virtual size of the image, it is the sum of `SHARED SIZE` and `UNIQUE SIZE`
    68  
    69  > **Note**
    70  >
    71  > Network information is not shown because it does not consume disk space.
    72  
    73  ## Performance
    74  
    75  The `system df` command can be very resource-intensive. It traverses the
    76  filesystem of every image, container, and volume in the system. You should be
    77  careful running this command in systems with lots of images, containers, or
    78  volumes or in systems where some images, containers, or volumes have very large
    79  filesystems with many files. You should also be careful not to run this command
    80  in systems where performance is critical.
    81  
    82  ## Format the output
    83  
    84  The formatting option (`--format`) pretty prints the disk usage output
    85  using a Go template.
    86  
    87  Valid placeholders for the Go template are listed below:
    88  
    89  | Placeholder    | Description                                |
    90  | -------------- | ------------------------------------------ |
    91  | `.Type`        | `Images`, `Containers` and `Local Volumes` |
    92  | `.TotalCount`  | Total number of items                      |
    93  | `.Active`      | Number of active items                     |
    94  | `.Size`        | Available size                             |
    95  | `.Reclaimable` | Reclaimable size                           |
    96  
    97  When using the `--format` option, the `system df` command outputs
    98  the data exactly as the template declares or, when using the
    99  `table` directive, will include column headers as well.
   100  
   101  The following example uses a template without headers and outputs the
   102  `Type` and `TotalCount` entries separated by a colon (`:`):
   103  
   104  ```bash
   105  $ docker system df --format "{{.Type}}: {{.TotalCount}}"
   106  
   107  Images: 2
   108  Containers: 4
   109  Local Volumes: 1
   110  ```
   111  
   112  To list the disk usage with size and reclaimable size in a table format you
   113  can use:
   114  
   115  ```bash
   116  $ docker system df --format "table {{.Type}}\t{{.Size}}\t{{.Reclaimable}}"
   117  
   118  TYPE                SIZE                RECLAIMABLE
   119  Images              2.547 GB            2.342 GB (91%)
   120  Containers          0 B                 0 B
   121  Local Volumes       150.3 MB            150.3 MB (100%)
   122  <Paste>
   123  ```
   124  
   125  **Note** the format option is meaningless when verbose is true.
   126  
   127  ## Related commands
   128  * [system prune](system_prune.md)
   129  * [container prune](container_prune.md)
   130  * [volume prune](volume_prune.md)
   131  * [image prune](image_prune.md)
   132  * [network prune](network_prune.md)