FAUN — Developer Community 🐾

We help developers learn and grow by keeping them up with what matters. 👉 www.faun.dev

Follow publication

Member-only story

Remove docker build cache

--

Sometimes an no space lefterror occurred when building Dockerfile .
When I checked the storage capacity used by Docker, it turned out that the build cache was extremely large.

$ docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 45 6 99.35GB 74.17GB (74%)
Containers 10 6 27.06GB 6.004GB (22%)
Local Volumes 7 1 0B 0B
Build Cache 414 0 41.58GB 41.58GB

I didn’t know how to clear this Build cache immediately, so I’ll leave it as a memo. The conclusion is very simple, you can delete it with the following command ( reference URL ).

$ docker builder prune

After executing this command, docker system dftry ...

$ docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 25 6 99.35GB 74.17GB (74%)
Containers 8 6 27.06GB 6.004GB (22%)
Local Volumes 3 1 0B 0B
Build Cache 96 0 0B 0B

I was able to erase it safely. If you’re using Docker and you’re worried about remaining storage space, it might be worth a try.

👋 If you find this helpful, please click the clap 👏 button below a few times to show your support for the author 👇

🚀Join FAUN Developer Community & Get Similar Stories in your Inbox Each Week

--

--

Published in FAUN — Developer Community 🐾

We help developers learn and grow by keeping them up with what matters. 👉 www.faun.dev

Written by Maciej

DevOps Consultant. I’m strongly focused on automation, security, and reliability.

Responses (1)

Write a response