Skip to content

Find what is using Docker disk space

Troubleshooting guides · Storage & drives

Docker can report gigabytes of reclaimable space while the drive holding its disk image stays almost full. Confirm which engine and builder you’re looking at, then measure the host drive separately.

Docker Desktop and local Docker Engine. Use an already running, confirmed local target.

Use the same shell and Docker client that the project uses. Check for an explicit --context or --host in the invocation and look at DOCKER_CONTEXT, DOCKER_HOST and DOCKER_CONFIG locally. DOCKER_CONTEXT takes precedence over DOCKER_HOST when selected through the environment. A context name alone tells you little about where the daemon runs. Check the endpoint, and if a host override or a wrapper is involved, verify its actual destination before sending a daemon request.

Docker CLI in the project’s terminal · Read-only check
docker context show
docker context inspect

Runs only when you paste it into your terminal and press Enter.

Confirm the endpoint belongs to your local running engine. A forwarding socket can lead elsewhere. If it is remote or unclear, stop here and check with the engine’s owner. Keep endpoints, TLS configuration, project names and credentials private. Docker CLI target selection

On Docker Desktop, check the platform, container mode and active backend in the app. For Linux containers on Mac, Linux or Windows Hyper-V, look for Settings → Resources → Advanced → Disk image location where supported. Docker documents the backend’s storage location and relocation controls separately for Desktop WSL 2. Use the configured path shown by your installation. A distribution list or default path alone cannot establish the live data location. Windows containers use different storage.

On a local Engine installation, confirm the configured Docker root and storage driver. Once the local endpoint is verified, docker info shows server details including the Docker Root Dir. Check separately for a containerd image store or a custom location. Bind mounts can point to other volumes. Keep Docker’s internal files under Docker’s management. Read the free bytes for the host filesystem that actually holds the affected data before doing any cleanup. Desktop settings by backend · Engine data directory

Against the confirmed local daemon, use:

Docker CLI · Read-only check
docker system df -v

Runs only when you paste it into your terminal and press Enter.

An illustrative excerpt from the detailed daemon view:

Images SIZE SHARED SIZE UNIQUE SIZE CONTAINERS
demo:old 900MB 700MB 200MB 0
demo:stable 850MB 700MB 150MB 1
Containers SIZE STATUS
demo-test 350MB Exited
Volumes LINKS SIZE
demo-db 0 6GB

Here demo:stable still needs the 700 MB of shared layers. The stopped container’s 350 MB is a writable layer, and the 6 GB volume is its own storage item. A link count of zero only tells you about current container references. The database could still be needed by the next deployment.

Read by storage owner:

  • Images. Shared layers can stay in use after you remove one tag or image. Unique size helps explain that relationship. Check whether required tags can be pulled again or rebuilt.
  • Containers. A stopped container can still hold changes in its writable layer. Confirm that useful state lives in a backed-up mount or can be recreated before even considering removal.
  • Volumes and bind mounts. A volume can contain a database with no active container. A bind mount is a path owned by its source filesystem or app. Verify the source, container dependencies and application-consistent recovery before any change.
  • Logs. If disk growth tracks a busy container, identify its logging driver and retention settings. The daemon summary cannot stand in for a log file inventory. Use Docker’s logging controls for future growth. Do not edit driver-managed log files. Docker logging configuration
  • Build cache. Confirm the builder’s driver and every node endpoint in your local configuration before querying disk usage. If supported, docker buildx ls shows builders and nodes, but can contact endpoints. Use it only after confirming the listed builders are local or with approval for the other endpoints. For one confirmed local builder, use docker buildx du --builder BUILDER_NAME with its exact name. A shared cache record can remain represented by an image even when BuildKit could remove its cache metadata. Builder disk usage

Keep daemon and builder totals separate. Some data can overlap. “Reclaimable” describes Docker eligibility and does not account for your retention needs or predict host free space. Daemon disk usage

For that builder, append --verbose if supported to read record IDs, descriptions, and shared and reclaimable flags. In this illustrative excerpt, the shared record may remain on disk through an image. The private record is a better candidate once you know which build can recreate it.

Builder record SIZE SHARED RECLAIMABLE
Base-image layer 700MB true true
Disposable compile output 2GB false true

Image. In Docker Desktop, open Images → Local. Confirm the exact tag and image ID and check View container usage if available. Verify the required registry access or build inputs. If you accept the re-download or rebuild cost and no container needs it, use the bin icon for that single row. Stop on dependency or scope prompts. Recheck the tag and the surviving image. Docker Desktop Images

Stopped container. Identify the exact stopped container in Containers. Review its Compose or run configuration and mounts. docker container diff CONTAINER_ID lists changed paths in its writable layer and can help find state to save. Check mounted data separately. If the container can be recreated and its needed state is backed up, use the individual container’s delete control. Skip group deletion and any prompt that also removes volumes. Confirm the container is gone and its required data remains recoverable. Docker container diff · Docker Desktop Containers

Volume or bind mount. In Docker Desktop’s Volumes view, open the exact named volume and check references. Check the project’s config for future users even when Docker shows none. For unique data, take an application-consistent backup on a different volume and validate the restore first. If the volume is explicitly disposable and unattached, review the single-volume delete control, then recheck the list. For bind mounts, use the owning application’s procedure on the source filesystem. Docker Desktop Volumes · Docker storage

Build cache. For one verified local builder, use docker buildx du --builder BUILDER_NAME --filter "id=RECORD_ID" --verbose where supported. Use the full record ID. Check that the result is one intended private, reclaimable record. Confirm the source and dependencies are recoverable and the next build can afford a cache miss. Share this scope with the builder owner for an exact-ID removal decision on their installed version, or review their documented garbage-collection policy if records cannot be isolated. Repeat the filtered lookup after an approved change. Builds may take longer or re-download inputs. Builder disk usage · Filtered build cache removal · Build cache retention

Logs. Check the exact container’s driver with docker inspect --format '{{.HostConfig.LogConfig.Type}}' CONTAINER_ID. If json-file is growing, review the service’s max-size and max-file settings with its owner. Changes apply to newly created containers. Plan recreation and downtime separately, save needed logs and writable state, and verify the replacement’s driver and options. This addresses future growth. Use the application’s retention control for logs it writes to a mount. Docker logging configuration · JSON file driver

If you need to move the disk image, verify the installed backend’s supported UI, destination capacity and backup before scheduling downtime. Keep factory reset and manual edits to managed disk images outside this procedure.

Illustrative case: a builder’s cache drops by 7 GB and the host volume gains 0.5 GB. This records a builder-level reduction and a small host gain. The virtual disk can retain blocks for later reuse, and concurrent writes can reduce the net gain. Re-read the same daemon or builder and the same host volume using the storage worksheet. For a personal WSL distribution, use the WSL guest and host checks.

If you use the disk-cleanup skill, ask it to verify the confirmed local engine and builder first, keep raw output local, and show host free space separately from Docker readings.

For host storage outside Docker, use the macOS or Linux cleanup guide.