Docker Image Cleanup

I’m dealing with storage space on a VM install (OS).
I’ll probably need to expand the virtual disk again, but wanted to clean things up before I did that.

I noticed the docker overlay2 directory was large, so started digging in a bit and found that there were some dangling images, so I pruned those.

But, I also see a number of containers/images that I think are old/should be removed, but at still present.

Below is the output of docker images:

ghcr.io/home-assistant/qemux86-64-homeassistant      2024.8.2    b65eb0f2d3e2   6 days ago      1.64GB
ghcr.io/hassio-addons/zwave-js-ui/amd64              3.10.0      3418ff1ea5cc   2 weeks ago     376MB
homeassistant/amd64-addon-matter-server              6.4.1       ff223c2d0350   2 weeks ago     529MB
ghcr.io/home-assistant/amd64-hassio-supervisor       2024.08.0   a59f7f3a2e74   2 weeks ago     366MB
ghcr.io/home-assistant/amd64-hassio-supervisor       latest      a59f7f3a2e74   2 weeks ago     366MB
homeassistant/amd64-hassio-supervisor                2024.08.0   a59f7f3a2e74   2 weeks ago     366MB
homeassistant/amd64-hassio-supervisor                latest      a59f7f3a2e74   2 weeks ago     366MB
ghcr.io/esphome/esphome-hassio                       2024.7.3    a8eda7422d47   3 weeks ago     498MB
ghcr.io/home-assistant/amd64-hassio-cli              2024.07.0   909f963c92f4   4 weeks ago     52.6MB
homeassistant/amd64-addon-mosquitto                  6.4.1       2f4c8bd91b57   2 months ago    209MB
ccab4aaf/amd64-addon-frigate-proxy                   1.5         7543a7a73674   4 months ago    167MB
ghcr.io/home-assistant/amd64-hassio-dns              2024.04.0   5c3e729cba11   4 months ago    58.7MB
ghcr.io/home-assistant/amd64-hassio-multicast        2024.03.0   73c70d06ef84   5 months ago    42.4MB
homeassistant/amd64-addon-configurator               5.8.0       5b6b5dab6789   6 months ago    117MB
6713e36e/amd64-addon-rtlamr2mqtt                     2.3.4       67ff1f9c47d2   8 months ago    149MB
golang                                               bullseye    8387d057079f   8 months ago    746MB
ghcr.io/sabeechen/hassio-google-drive-backup-amd64   0.112.1     3abdf7e0a6df   8 months ago    326MB
python                                               3.10-slim   7bae896aa892   10 months ago   127MB
ghcr.io/home-assistant/amd64-hassio-observer         2023.06.0   5a1f2299c4fa   14 months ago   7.76MB
golang                                               <none>      f7d4f5578ce3   22 months ago   992MB
homeassistant/amd64-hassio-supervisor                2022.09.1   2926dcc07c30   23 months ago   334MB
golang                                               <none>      4f7c78c9b46f   23 months ago   992MB
ghcr.io/hassio-addons/debian-base/amd64              5.1.0       63ca583608d8   2 years ago     96.5MB

I believe these images can go?
But, I don’t care to break anything either…

homeassistant/amd64-hassio-supervisor                2022.09.1   2926dcc07c30   23 months ago   334MB
golang                                               <none>      4f7c78c9b46f   23 months ago   992MB
golang                                               <none>      f7d4f5578ce3   22 months ago   992MB

The logs directory is somewhat large at 2.4G. But that seems okay I guess.

which prune options do you use?

Perhaps try:

docker system prune -a --volumes

-a will remove all unsused images, not just dangling ones.
--volumes removes all anonymous volumes

I’ve only done

docker image prune

I ran it again just now and it got rid of those old “golang” images. So the only one left now I think is that old 2022.09.1 supervisor.

I’m curious why HA OS isn’t clearing them though too.

I don’t know anything about HAOS; I use HA Container (docker),

Tbh, now I know your’e running HAOS, I’d let it manage its environment without interference as that is what it’s designed to do.

Appreciate your feedback. I posted in the HAOS category on purpose :slight_smile:

Having said that, I believe it’s the Supervisor, not OS that would be in charge of managing this, and I think it should be automatically clearing the old stuff. But maybe something went wrong at some point :man_shrugging:t2:

Ugh - didn’t spot that.