no space left on device error is due to high Docker usage


This post is written 21 months ago. Probably the information might be out of date.

Problem

I encountered the error which I have never seen.

error: could not create directory : No space left on device
copied!

I checked the local storage on my MacBook. It has enough storage and It seems no problem.

Maybe the amount of disk space used by docker ?

I checked disk space used by the docker demon with the command below.

docker system df
copied!

According to the response on terminal, it seems docker demon uses a lot of Volumes.

Solution

This command is the solution!

docker volume prune
copied!

This is a command that remove unused local volumes which are not referenced by any containers.

buy me a coffee