Know the host and project

Confirm the Docker context and Compose project. Inventory containers, images, networks and storage use, then connect each object to the service that owns it.

Separate a space problem from a health problem. Removing unused image layers will not fix a dependency timeout, and restarting an unhealthy service will not explain why its health check failed.

Check useful application behavior

Review container state, restart counts, recent logs and health-check output. Confirm that the application responds through the path its users or upstream services actually use.

If the check fails, inspect its assumptions: executable availability, timeout, expected endpoint and required dependencies. A broken health check can make a functioning process appear unhealthy.

Treat persistent storage separately

Identify named volumes and bind mounts before preparing a cleanup. Confirm data ownership, retention needs and the most recent recoverable backup.

An unused-looking volume may belong to a stopped workload or a recovery process. Review it with the service owner rather than treating the absence of a running container as proof that the data is disposable.

Plan a service-sized change

Choose the smallest service or resource that addresses the evidence. Describe expected downtime, dependencies and rollback constraints. Preserve the current configuration and image reference so the intended recovery path is reproducible.

Pin the intended image version for a deployment. A mutable tag alone is not a reliable record of the artifact you meant to run.

Verify and leave a better runbook

After the approved change, check service health, logs, restart stability and the actual application endpoint. Stop and investigate if the expected result does not appear.

Record which objects changed and what proved recovery. A concise, reviewed runbook makes the next maintenance window easier without turning uncertainty into an automatic action.

Further reading

Consult the documentation for your installed version and review commands against your own environment.

Docker: Prune unused objects