DOCKER-BUILDX-PRUNE(1)

πŸ“¦ version 0.13.1, in debian trixie

πŸ’… docker-buildx-prune β€” the "okay bestie, time to clean house" page

So like… this is part of the docker-buildx manual set (section 1, for the record πŸ“–), and it's literally just about Remove build cache. That's it. That's the whole gig. Let's go 🧹✨


✨ NAME ✨

docker-buildx-prune β€” Remove build cache πŸ—‘οΈπŸ’–


🌸 SYNOPSIS 🌸

docker buildx prune

πŸ¦‹ DESCRIPTION πŸ¦‹

Clears the build cache of the selected builder. Yeah. All that accumulated ✨stuff✨ from your builds? Gone. Poof. Iconic behaviour tbh πŸ’…

And because you're a main character who likes control, 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. πŸ‘€ (yes, the hidden ones. the backstage crew. we see them.)

πŸŽ€ OPTIONS πŸŽ€

  • -a, --all[=false] β€” Include internal/frontend images 🫣
  • --filter= β€” Provide filter values (e.g., "until=24h") πŸ”
  • -f, --force[=false] β€” Do not prompt for confirmation (living dangerously, love that for you) 😌
  • -h, --help[=false] β€” help for prune πŸ†˜
  • --keep-storage=0 β€” Amount of disk space to keep for cache πŸ’Ύ
  • --verbose[=false] β€” Provide a more verbose output πŸ—£οΈ

🌈 OPTIONS INHERITED FROM PARENT COMMANDS 🌈

  • --builder="" β€” Override the configured builder instance πŸ—οΈ

⭐ EXAMPLE ⭐

### Override the configured builder instance (--builder) {#builder}

Same as [buildx --builder](/reference/cli/docker/buildx/#builder). Go peek at that one, bestie, it's got the lore 🫢


πŸ‘‘ SEE ALSO πŸ‘‘


no cap, if you're about to nuke your cache: check --keep-storage first so you don't delete your entire personality. your build times will thank you πŸ™ˆ

okay that's the whole page, you ate that πŸ’…βœ¨ this was the DOCKER-BUILDX-PRUNE(1) page, straight from the docker-buildx source, dated Apr 2025 β€” love you, go clear some cache, mwah πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from