github.com/khulnasoft/cli@v0.0.0-20240402070845-01bcad7beefa/docs/reference/commandline/system_df.md (about)

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