docker buildx prune

内容説明Remove build cache
利用方法docker buildx prune

内容説明

Clears the build cache of the selected builder.

You can finely control what cache data is kept using:

  • The --filter=until=<duration> flag to keep images that have been used in the last <duration> time.

    <duration> is a duration string, e.g. 24h or 2h30m, with allowable units of (h)ours, (m)inutes and (s)econds.

  • The --keep-storage=<size> flag to keep <size> bytes of data in the cache.

    <size> is a human-readable memory string, e.g. 128mb, 2gb, etc. Units are case-insensitive.

  • The --all flag to allow clearing internal helper images and frontend images set using the #syntax= directive or the BUILDKIT_SYNTAX build argument.

オプション

オプションデフォルト内容説明
-a, --allInclude internal/frontend images
--filterProvide filter values (e.g., until=24h)
-f, --forceDo not prompt for confirmation
--max-used-spaceMaximum amount of disk space allowed to keep for cache
--min-free-spaceTarget amount of free disk space after pruning
--reserved-spaceAmount of disk space always allowed to keep for cache
--verboseProvide a more verbose output

利用例

Override the configured builder instance (--builder)

Same as buildx --builder.