Check disk usage for a specific builder instance
In this step, you will learn how to check the disk usage for a specific Docker builder instance. By default, docker buildx du
shows the disk usage for the currently active builder. However, you might have multiple builder instances configured, and you may want to inspect the cache usage for a different one.
First, let's list the available builder instances to identify the one you want to inspect. You can do this using the docker buildx ls
command:
docker buildx ls
The output will show a list of your builder instances. Look for the NAME
column to identify the name of the builder you are interested in. The currently active builder will be marked with an asterisk (*
).
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
default * docker running v0.10.5+a34f333b1f linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
mybuilder docker-container running v0.10.5+a34f333b1f linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
Now, to check the disk usage for a specific builder instance, you can use the --builder
flag followed by the name of the builder. For example, if you have a builder named mybuilder
, you would run:
docker buildx du --builder mybuilder
Replace mybuilder
with the actual name of the builder instance you want to inspect. This command will display the disk usage specifically for the cache associated with that builder instance. This is useful if you are working with different builder configurations or if you want to isolate the cache usage of a particular build environment.