KHOI | Blog

Troubleshooting ENOSPC no space left on device — Docker

Thu, Aug 01, 2024 · 2 min read
Blog post image

Recently ran into an issue where I deployed a NextJS app with Docker on my DigitalOcean Ubuntu VPS and it logged this out while building: ENOSPC no space left on device.

So I ran df -h to view how much space on my disk left. This is what I got:

Filesystem  ...     Use%   Mounted on
/dev/vda1   ...      100%   /

Fortunately, I found this Stackoverflow article, and realized that my Docker app had been creating containers and those became orphaned or unused. This is not so obvious, since running docker ps and docker image ls did not show these orphaned containers (or maybe my skill issue).

So to clean these up, all I had to do was running docker system prune --all and said Yes to the CLI prompt. Now, running df -h again showed me this:

Filesystem  ...     Use%   Mounted on
/dev/vda1   ...      59%   /

Then, I ran the command to rebuild and deploy the Docker app. Everything worked as usual!