October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Docker Image Cleanup: Verify the Container Before You Delete

Bare SHA IDs in docker ps made a live homelab image look unused. Here’s how to inspect container image references and avoid risky Docker cleanup.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Docker image that looks unused in summary output may still back a live service. In Christian Anderson’s homelab, docker ps --format '{{.Image}}' printed bare SHA IDs instead of names. He thought unclecode/crawl4ai was unattached, then confirmed it was running, healthy, and serving traffic. Before removing an image, connect it to the containers that use it and check whether those services are doing their intended work.

Why the image looked orphaned

Anderson describes a specific Docker homelab incident: output from docker ps --format '{{.Image}}' showed bare SHA values rather than familiar image names. The unfamiliar output made unclecode/crawl4ai look unused. A closer check showed the image was associated with a running, healthy container that was serving traffic. The incident is his account, not a claim that every Docker version or host formats output the same way. Read Anderson’s account.

As an Amazon Associate I earn from qualifying purchases.

The practical risk is a mistaken cleanup decision: an image that appears unattached in a quick view may be one docker rmi away from affecting a live service if you remove it without checking references. Do not treat a label or short summary as a dependency audit.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify which image a running container uses

Use the container’s detailed configuration to connect a container to its configured image. Docker documents docker inspect as a way to return detailed, low-level information about Docker objects, including the image field. Docker’s inspect reference demonstrates reading .Config.Image.

  1. List running containers with docker ps and identify the container or service whose image looks unfamiliar.

  2. Print each running container’s name and configured image:

    for id in $(docker ps -q); do docker inspect -f '{{.Name}} {{.Config.Image}}' "$id"; done

    Compare the resulting image names with the SHA values or other entries you saw in the summary output.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  3. Check a relevant listening port or another service-specific signal. Anderson used a port check as corroborating evidence; a listening port alone does not prove that a service is working as intended.

  4. Before any removal, check for references beyond running containers, including stopped containers and workloads you intend to start later.

Inspecting configured image names helps resolve the immediate ambiguity; checking service activity helps establish whether a live workload matters. Neither step should be replaced by an estimated reclaimable-space figure.

What Docker image prune removes

Docker’s documented prune commands have different scopes. The default docker image prune removes dangling images. Adding -a broadens the selection to images not referenced by any container, including containers that are not running. Read the Docker image prune reference before using either command.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Command Documented scope What to check first
docker image prune Dangling images by default Review what Docker considers dangling and confirm the host’s cleanup policy.
docker image prune -a Images not referenced by any container Check stopped containers and planned workloads; an image can be needed even when no current container references it.

These commands are not equivalent to asking whether an image is serving traffic. Prune scope is based on image references; service checks answer a different operational question. If you are uncertain, review the candidate images and references before running broad cleanup rather than treating an unattended prune as a complete safety check.

“Orphaned” has a separate meaning in Compose

In this incident, “orphaned” describes Anderson’s mistaken impression that an image was unattached. Docker Compose uses “orphaned services” for a different relationship: services that are not declared in the current project definition. The Compose ps reference describes an option to include services not declared by the project. That Compose label does not establish whether a particular image is unused or whether a container is stopped.

Configuration on disk may not match the live container

Editing a Compose file or application directory does not necessarily update a container that already exists. Anderson recounts finding restart: unless-stopped in a Compose file while an older container still had restart=no, because it had not been recreated. He also describes changes to environment configuration and application code that did not take effect in already-created containers. These are examples from his setup, not guarantees about every deployment.

When behavior conflicts with the files you expect to be running, inspect the live container rather than assuming the current files have been applied. Determine whether the change requires recreating the container or rebuilding its image, then use the deployment process appropriate to that workload. Verify the resulting container’s configuration and behavior after making the change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A healthy status is not proof of working service

A health check reports the condition it was configured to test; it does not automatically validate every expected function. Anderson describes a tunnel container that appeared healthy without connecting the expected tunnel, and a GPU workload that fell back to CPU in his particular hardware and software combination. His concise warning was: “Healthy means the process is up. It doesn’t mean it’s doing its job.”

Choose a check that tests the service outcome you care about: for example, verify the expected tunnel connection or confirm that a workload is actually using the intended accelerator. A process status or health indicator is useful evidence, but it is not a substitute for testing the function the service exists to provide.

Reclaimable space is an estimate, not a cleanup plan

Anderson reported four guests 82% to 86% full — Christian Anderson, 2026 — and docker system df showed 6.67 GB shown as reclaimable — Christian Anderson, 2026. His investigation pointed to images and build cache rather than cold data; the cleanup reclaimed about 340 MB reclaimed in the cleanup — Christian Anderson, 2026. These are observations from his homelab, not independently validated benchmarks or typical results for Docker hosts.

He also reports removing 16 superseded tags listed at about 240 MB each but freeing only 60 MB because the builds shared layers. In his cleanup, per-tag sizes therefore did not predict additive storage savings. Some images that were not running were still referenced by Compose files, another reason the apparent reclaimable amount did not serve as a complete inventory of safe-to-remove workloads.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Anderson says he grew guest disks online using capacity from an existing thin pool. That was a choice for his Proxmox and storage setup, not a universal storage prescription. The general lesson is narrower: identify what is actually consuming space, understand shared-layer effects, and review image references before pruning.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.