🔥 HOT: Reference/cli/docker/buildx/du - HD Photos!

docker buildx du

DescriptionDisk usage
Usagedocker buildx du

Description

Disk usage

Options

OptionDefaultDescription
--filterProvide filter values
--formatFormat the output
--verboseShorthand for --format=pretty

Examples

Show disk usage

The docker buildx du command shows the disk usage for the currently selected builder.

If RECLAIMABLE is false, the docker buildx du prune command won't delete the record, even if you use --all. That's because the record is actively in use by some component of the builder.

The asterisks (*) in the default output format indicate the following:

  • An asterisk next to an ID (zu7m6evdpebh5h8kfkpw9dlf2*) indicates that the record is mutable. The size of the record may change, or another build can take ownership of it and change or commit to it. If you run the du command again, this item may not be there anymore, or the size might be different.
  • An asterisk next to a size (8.288kB*) indicates that the record is shared. Storage of the record is shared with some other resource, typically an image. If you prune such a record then you will lose build cache but only metadata will be deleted as the image still needs to actual storage layers.

Provide filter values (--filter)

Same as buildx prune --filter.

Format the output (--format)

The formatting options (--format) pretty-prints usage information output using a Go template.

Valid placeholders for the Go template are:

  • .ID
  • .Parents
  • .CreatedAt
  • .Mutable
  • .Reclaimable
  • .Shared
  • .Size
  • .Description
  • .UsageCount
  • .LastUsedAt
  • .Type

When using the --format option, the du command will either output the data exactly as the template declares or, when using the table directive, includes column headers as well.

The pretty format is useful for inspecting the disk usage records in more detail. It shows the mutable and shared states more clearly, as well as additional information about the corresponding layer:

The following example uses a template without headers and outputs the ID and Size entries separated by a colon (:):

The following example uses a table template and outputs the ID and Description:

JSON output is also supported and will print as newline delimited JSON:

You can use jq to pretty-print the JSON output:

Use verbose output (--verbose)

Shorthand for --format=pretty:

Override the configured builder instance (--builder)

Use the --builder flag to inspect the disk usage of a particular builder.