github.com/pdmccormick/importable-docker-buildx@v0.0.0-20240426161518-e47091289030/docs/reference/buildx_prune.md (about)

     1  # buildx prune
     2  
     3  ```text
     4  docker buildx prune
     5  ```
     6  
     7  <!---MARKER_GEN_START-->
     8  Remove build cache
     9  
    10  ### Options
    11  
    12  | Name                    | Type     | Default | Description                               |
    13  |:------------------------|:---------|:--------|:------------------------------------------|
    14  | `-a`, `--all`           |          |         | Include internal/frontend images          |
    15  | [`--builder`](#builder) | `string` |         | Override the configured builder instance  |
    16  | `--filter`              | `filter` |         | Provide filter values (e.g., `until=24h`) |
    17  | `-f`, `--force`         |          |         | Do not prompt for confirmation            |
    18  | `--keep-storage`        | `bytes`  | `0`     | Amount of disk space to keep for cache    |
    19  | `--verbose`             |          |         | Provide a more verbose output             |
    20  
    21  
    22  <!---MARKER_GEN_END-->
    23  
    24  ## Description
    25  
    26  Clears the build cache of the selected builder.
    27  
    28  You can finely control what cache data is kept using:
    29  
    30  - The `--filter=until=<duration>` flag to keep images that have been used in
    31    the last `<duration>` time.
    32  
    33    `<duration>` is a duration string, e.g. `24h` or `2h30m`, with allowable
    34    units of `(h)ours`, `(m)inutes` and `(s)econds`.
    35  
    36  - The `--keep-storage=<size>` flag to keep `<size>` bytes of data in the cache.
    37  
    38    `<size>` is a human-readable memory string, e.g. `128mb`, `2gb`, etc. Units
    39    are case-insensitive.
    40  
    41  - The `--all` flag to allow clearing internal helper images and frontend images
    42    set using the `#syntax=` directive or the `BUILDKIT_SYNTAX` build argument.
    43  
    44  ## Examples
    45  
    46  ### <a name="builder"></a> Override the configured builder instance (--builder)
    47  
    48  Same as [`buildx --builder`](buildx.md#builder).