Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • C#
  • Asp.Net Core
  • SQL
  • Windows
  • WordPress
  • AI
  • JavaScript
  • CSS
  • MORE
    • HTML
    • Ajax
    • Git
    • Docker
    • Kubernetes
    • Photoshop
    • Visual Studio

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • C#
  • Asp.Net Core
  • SQL
  • Windows
  • WordPress
  • AI
  • JavaScript
  • CSS
  • MORE
    • HTML
    • Ajax
    • Git
    • Docker
    • Kubernetes
    • Photoshop
    • Visual Studio
Docker

Docker: Fix ‘No Space Left on Device’ Without Deleting Your Actual Data

- 30.08.26 | 31.08.26 - ErcanOPAK

🐳 No Space Left ≠ Delete Your Volumes

Docker throwing no space left on device makes it tempting to start deleting things fast — but the actual culprit is almost always accumulated build cache, dangling images, and stopped containers, none of which hold data you need.

🔍 Find What’s Actually Eating Space First

docker system df -v
# Shows a breakdown: Images, Containers, Local Volumes, Build Cache
# - usually "Build Cache" and dangling "<none>" images are the
# biggest, most disposable offenders, often for many GB.

✅ Safe Cleanup, Broadest to Narrowest

  • Start with the safest command and check if it freed enough space before reaching for anything broader.
  • None of the commands below touch named volumes by default — that’s the deliberate safety boundary.

🧹 Cleanup Commands, Safest First

# Removes stopped containers, dangling images, unused networks,
# and build cache - does NOT touch volumes or running containers
docker system prune

# Also removes images not currently used by ANY container
# (not just dangling ones) - more aggressive but still volume-safe
docker system prune -a

# Only if you're SURE: also removes unused volumes.
# This DOES delete data if a volume isn't attached to a container
# right now - check "docker volume ls" and inspect first.
docker system prune -a --volumes

⚠️ Before You Add –volumes

  • Run ‘docker volume ls’ and cross-check each one against ‘docker ps -a’ — a volume for a container you stopped last week but plan to restart is NOT safe to delete.
  • Named volumes for databases (Postgres, MySQL, etc.) hold your actual data — deleting them is equivalent to dropping the database.

docker system df tells you exactly where the space went before you delete anything — skip that step and “cleaning up” becomes indistinguishable from “deleting data.”

— DevOps Engineer

Related posts:

Docker: Fix a Health Check That Passes Locally but Always Fails Inside Compose

Docker: Fix a Health Check That Passes Locally but Always Fails Inside Compose

Docker: Fix a .NET App Crashing Only on Alpine From Missing glibc

Docker: Fix a .NET App Crashing Only on Alpine From Missing glibc

Docker: Fix a Healthcheck Interval Too Slow to Catch a Crash Loop

Docker: Fix a Healthcheck Interval Too Slow to Catch a Crash Loop

Views: 9
Found this useful? Share it
XLinkedInWhatsApp

Post navigation

WordPress: Stop ‘Briefly Unavailable for Scheduled Maintenance’ From Getting Stuck Forever
Photoshop: Fix Banding in Gradients With One Setting Nobody Turns On

Leave a Reply Cancel reply

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

Most Read

  1. 01How to make theater mode the default for Youtube 1,079 views
  2. 02How to add default value for Entity Framework migrations for DateTime and Bool 997 views
  3. 03Get the User Name and Domain Name from an Email Address in SQL 996 views
  4. 04Get the First and Last Word from a String or Sentence in SQL 873 views
  5. 05How to select distinct rows in a datatable in C# 868 views
  6. 06How to enable, disable and check if Service Broker is enabled on a database in SQL Server 671 views
  7. 07Add Constraint to SQL Table to ensure email contains @ 631 views
  8. 08Average of all values in a column that are not zero in SQL 584 views
  9. 09How to use Map Mode for Vertical Scroll Mode in Visual Studio 561 views
Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
Back to top
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com