Docker에서 사용하는 디스크 공간을 확보하는 방법

작성자

카테고리:

← 피드로
DEV Community · Isaias Velasquez · 2026-07-04 개발(SW)
Cover image for How to free up disk space used by Docker

Isaias Velasquez

How to free up disk space used by Docker

When you use Docker on a daily basis, your disk can get full of unnamed images, stopped containers, dangling volumes and build cache. Here is how to clean all that up.

First, check how much space Docker is using:

docker system df

Enter fullscreen mode Exit fullscreen mode

This will show you images, containers, volumes and build cache with their sizes.

To remove all stopped containers, dangling images and unused networks in one go:

docker system prune -f

Enter fullscreen mode Exit fullscreen mode

If you also want to remove dangling volumes:

docker system prune -af --volumes

Enter fullscreen mode Exit fullscreen mode

Just be careful with the –volumes flag. Once they are gone, any data stored in anonymous volumes is lost.

Now if you want to remove only what is old:

docker system prune -af --filter "until=24h"

Enter fullscreen mode Exit fullscreen mode

The –filter flag removes everything created or used more than 24 hours ago.

That’s all for now.
Thanks for reading!

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다