November 6, 20241 yr I often see posts automatically assuming user error in not binding logs etc. to persistent storage as the reason for a large docker volume. While that can be true, there are many cases when the docker images might be large adding up to the large docker volume. This post is to help definitively answer that. Images, Containers, Volumes... If Images are taking up most of the space, then you are running containers with large images, and it is likely not a case of incorrect mapping. Run the following command: docker system df This is the output from my system: TYPE TOTAL ACTIVE SIZE RECLAIMABLE Images 61 57 41.74GB 2.207GB (5%) Containers 65 57 4.406GB 82.56kB (0%) Local Volumes 525 7 6.082GB 6.081GB (99%) Build Cache 119 0 938.1MB 938.1MB As you can see, I do have containers that have large images. Lets see what they are List all containers in descending order of image size: docker ps --format "{{.ID}}\t{{.Image}}" | while read id image; do size=$(docker image inspect $image --format='{{.Size}}'); echo -e "$size\t$id\t$image"; done | sort -nr | awk '{printf "%.2f MB\t%s\t%s\n", $1/1024/1024, $2, $3}' Here is a sample of output in my system: 4650.39 MB 8a3dea858fc2 ghcr.io/blakeblackshear/frigate:stable-tensorrt 3891.40 MB dfe0cd71485d sameersbn/gitlab 3125.77 MB 0ecd52d154a3 ollama/ollama 2295.23 MB 6479f874c647 ghcr.io/ollama-webui/ollama-webui:main 2240.48 MB 5e76761352ec binhex/arch-qbittorrentvpn 2081.17 MB 62c422a06451 photoprism/photoprism 2081.17 MB 3e4eca35def8 photoprism/photoprism 2081.17 MB 3167b1b03e5e photoprism/photoprism 1695.60 MB b8fdf429129b binhex/arch-lidarr 1655.56 MB 2af5a08e546e binhex/arch-delugevpn:latest 1089.15 MB a59e198c391b bokker/unraidapi-re 931.06 MB dd9d56275356 linuxserver/nextcloud 695.54 MB fca5f682288e sctx/overseerr:latest 669.66 MB a74e31a4cbed metabase/metabase:latest 603.31 MB e7272f88f2fb linuxserver/sonarr:0.6.1385 562.54 MB 47f8de7efd63 ghcr.io/esphome/esphome:stable 532.10 MB 644abfadeb96 rhasspy/wyoming-whisper 490.14 MB 799d4db50a9e golift/telegraf 486.44 MB 73281bc7ba55 ghcr.io/music-assistant/server:latest 462.53 MB 8d897f0f2dce grafana/grafana:latest Based on this, I now can make an informed decision on do I want to remove/delete any of my containers, or if I have enough resources to not be bothered by it. Maybe I can explore if I should bind persistent volume for the tensor models for frigate... I did do that for openvscodeserver, where I was able to bind all binaries to persistent storage Tell me more about the container - do I have containers with volumes unintentionally bound to the docker volume? While you can also see this in Unraid UI, if you are someone like me running way too many containers, it might be easier to analyze an output from CLI. This is what I used: docker inspect --format="{{ .Name }} {{ .Mounts }}" $(docker ps -aq) Sample output in my system: /prometheus [{bind /mnt/cache_appdata/appdata/prometheus/etc /etc/prometheus rw true rprivate} {bind /mnt/cache_appdata/appdata/prometheus/data /prometheus rw true rprivate}] /jackettvpn [{volume 9fbfc9969581ff252cfc8d18626e600ae4359baf52834b1be0e5d34d42276234 /var/lib/docker/volumes/9fbfc9969581ff252cfc8d18626e600ae4359baf52834b1be0e5d34d42276234/_data /blackhole local true } {bind /mnt/cache_appdata/appdata/jackettvpn /config rw true rprivate}] /QDirStat [{bind /tmp /ram rw true rprivate} {bind /var /var_dir rw true rslave} {bind /mnt/cache_appdata/appdata/QDirStat /config rw true rprivate} {bind /mnt /storage ro false rprivate}] /crowdsec [{bind /mnt/cache_appdata/appdata/traefik/crowdsec /etc/crowdsec rw true rprivate} {bind /mnt/cache_appdata/appdata/traefik/log /var/log/traefik ro false rprivate} {bind /mnt/cache_appdata/appdata/nextcloud/log /var/log/nextcloud ro false rprivate} {bind /mnt/cache_appdata/appdata/traefik/crowdsec/log /var/log rw true rprivate} {bind /mnt/cache_appdata/appdata/bitwarden/bitwarden.log /var/log/bitwarden/bitwarden.log ro false rprivate} {bind /mnt/cache_appdata/appdata/traefik/crowdsec/data /var/lib/crowdsec/data rw true rprivate}] /nextcloud [{bind /mnt/cache_appdata/appdata/nextcloud /config rw true rprivate} {bind /mnt/user/nextcloud /data rw true rprivate}] Lastly, some basic housekeeping: Prune dangling images ie. images that are no longer needed because you removed the container: docker image prune If you want to prune images of any container that is currently stopped/paused: docker image prune -a Hope this is helpful!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.