ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

docker image๋ฅผ buildํ–ˆ๋”๋‹ˆ build์— ์‹คํŒจํ–ˆ๋Š”๋ฐ ์›์ธ์€ no space left on device ๊ณต๊ฐ„์ด ์—†์–ด์„œ์ด๋‹ค. docker system df -v๋กœ ํ™•์ธํ•ด๋ณด๋‹ˆ ์—„์ฒญ๋‚˜๊ฒŒ ๋งŽ์€ cache๊ฐ€ ์Œ“์—ฌ์žˆ์—ˆ๋‹ค. docker๋Š” layer๋ฅผ ์Œ“์„ ๋•Œ cache๋ฅผ ์ด์šฉํ•ด ์ด๋ฏธ์ง€ ๋นŒ๋“œ์™€ ์ปจํ…Œ์ด๋„ˆ ์ƒ์„ฑ ์‹œ๊ฐ„์„ ์ค„์ด๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.

$docker system df -v

Images space usage:

REPOSITORY    TAG       IMAGE ID       CREATED        SIZE      SHARED SIZE   UNIQUE SIZE   CONTAINERS
snapshot      latest    35grewd50504   12 days ago    14.97GB   0B            14.97GB       0
latest        latest    efdkd936hd3c   2 weeks ago    29.59GB   0B            29.59GB       0

Containers space usage:

CONTAINER ID   IMAGE     COMMAND   LOCAL VOLUMES   SIZE      CREATED   STATUS    NAMES

Local Volumes space usage:

VOLUME NAME   LINKS     SIZE

Build cache usage: 14.63GB

๋”ฐ๋ผ์„œ cache๋ฅผ ์ œ๊ฑฐํ•ด ์šฉ๋Ÿ‰์„ ํ™•๋ณดํ•˜๋ ค ํ•œ๋‹ค.

cache ์‚ญ์ œ ๋ช…๋ น์–ด๋Š” ์•„๋ž˜์ฒ˜๋Ÿผ ํ•˜๋ฉด ๋œ๋‹ค.

sudo docker system prune -a

๊ทธ๋Ÿฌ๋ฉด ์•„๋ž˜์ฒ˜๋Ÿผ password๋ฅผ ์ž…๋ ฅํ•˜๋ผ๊ณ  ํ•œ๋‹ค. ์ž…๋ ฅํ•˜๋ฉด cache๋ฅผ ์‚ญ์ œํ•œ๋‹ค.

๋งจ ๋งˆ์ง€๋ง‰ ๋ผ์ธ์— ์ œ๊ฑฐ๋œ cache์˜ ์ „์ฒด ์šฉ๋Ÿ‰์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

Password:
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all images without at least one container associated to them
  - all build cache

Are you sure you want to continue? [y/N] y
Deleted Images:

Deleted build cache objects:

Total reclaimed space: 41.62GB

41GB๋‚˜ ๋๋‹ค…์–ผ๋งˆ๋‚˜ ์ •๋ฆฌ๋ฅผ ์•ˆํ•œ๊ฑด์ง€..๐Ÿคญ

์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
ยซ   2025/05   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Total
Today
Yesterday