Jenkins
CI/CD
빌드/배포 자동화 수행 중 오류가 발생
No space left on device
Jenkins
CI/CD
가 반복적으로 수행되는 과정에서 Build Cache
가 쌓이면서 문제 발생$ docker system df
: 현재 사용중인 이미지, 컨테이너 및 볼륨이 얼마나 많은 공간을 사용하고 있는지 확인할 수 있는 명령어. 뒤에 -v
(vervose)옵션을 추가하면 사용하지 않는 이미지와 컨테이너도 확인 가능$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 311G 310G 284M 100% /
...
$ sudo docker system df -v
Images space usage:
REPOSITORY TAG IMAGE ID CREATED SIZE SHARED SIZE UNIQUE SIZE CONTAINERS
server/backend latest aa4d75651096 4 hours ago 2.36GB 0B 2.356GB 1
server/flask latest 2df4d4b0373f 9 hours ago 1.71GB 0B 1.714GB 1
server/sdwebui latest 97b0cc844eb6 13 days ago 12.9GB 0B 12.9GB 1
server/jenkins latest 53eb4ac17ccf 3 weeks ago 996MB 0B 996.1MB 1
redis latest 170a1e90f843 2 months ago 138MB 0B 137.7MB 1
Containers space usage:
CONTAINER ID IMAGE COMMAND LOCAL VOLUMES SIZE CREATED STATUS NAMES
51fea23b7f65 server/backend "java -Dfile.encodin…" 0 69.8MB 4 hours ago Up 4 hours server-backend
0bcf716ad266 server/flask "python -m app" 0 75.9kB 9 hours ago Up 9 hours peaceful_poincare
ec6a6ba85069 redis:latest "docker-entrypoint.s…" 1 970B 12 days ago Up 12 days server-redis
d45a7633117c server/sdwebui "/bin/sh -c './webui…" 0 1.52MB 13 days ago Up 13 days server-sdwebui
b4f0930a3620 server/jenkins "/usr/bin/tini -- /u…" 0 2.68GB 2 weeks ago Up 2 weeks server-jenkins
Local Volumes space usage:
VOLUME NAME LINKS SIZE
frontend 0 986.1MB
99fbae4584bbc073085c13eb3521a2b8fc8e473e49d8e416bd0c2a0fad52d622 1 692B
Build cache usage: 239.1GB
CACHE ID CACHE TYPE SIZE CREATED LAST USED USAGE SHARED
tedxqgtdxyuo regular 0B 3 weeks ago 3 weeks ago 1 true
o0ctbsb203zx regular 0B 3 weeks ago 3 weeks ago 1 true
rj7x1gryphqf regular 0B 3 weeks ago 3 weeks ago 1 true
lwkf9nf8n56i regular 0B 3 weeks ago 3 weeks ago 1 true
9xgrulsw4agg regular 0B 3 weeks ago 3 weeks ago 1 true
...
wnxw3nbkq9lq source.local 1.08kB 13 days ago 4 hours ago 72 false
kk63u2877y75 source.local 1.43GB 13 days ago 4 hours ago 72 false
u961phqnm9hk source.local 0B 13 days ago 4 hours ago 72 false
yi0bk5rb8196 regular 1.43GB 4 hours ago 4 hours ago 1 false
qx24ltqc2i91 regular 374MB 4 hours ago 4 hours ago 1 false
$ docker {option} prune
: 사용하지 않는 컨테이너 이미지를 제거하는 명령어.
docker volume prune
: 미사용 볼륨 제거docker container prune
: 미사용 컨테이너 제거docker image prune
: 미사용 이미지 제거docker system prune
: 미사용 중인 이미지, 컨테이너, 볼륨 모두 제거$ sudo docker system prune
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- unused build cache
Are you sure you want to continue? [y/N] y
Deleted build cache objects:
srcnm8ftb1v79f6ettaf2bb6z
w8680tyap8d997hqucw9q6r44
pqtcfdmmueoyvjn7k3d5n0kat
i9opfym5x8wqm66huz0hxqu8e
v36akpatuyaoa7xgwb5sq89zi
...
972yylz5mtkcx7jpk2aknp1go
ocgyuijoqbqozrtiryt5xsuk6
i44z9mydueux37f9axhgecs1p
kmxd7dz6hu9izv9ww8egsdfzf
rp8d0tqyi6f8g0fftmjaqrb2a
Total reclaimed space: 239.1GB
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 311G 76G 235G 25% /
...
$ sudo docker system df -v
Images space usage:
REPOSITORY TAG IMAGE ID CREATED SIZE SHARED SIZE UNIQUE SIZE CONTAINERS
server/backend latest aa4d75651096 4 hours ago 2.36GB 0B 2.356GB 1
server/flask latest 2df4d4b0373f 9 hours ago 1.71GB 0B 1.714GB 1
server/sdwebui latest 97b0cc844eb6 13 days ago 12.9GB 0B 12.9GB 1
server/jenkins latest 53eb4ac17ccf 3 weeks ago 996MB 0B 996.1MB 1
redis latest 170a1e90f843 2 months ago 138MB 0B 137.7MB 1
Containers space usage:
CONTAINER ID IMAGE COMMAND LOCAL VOLUMES SIZE CREATED STATUS NAMES
51fea23b7f65 server/backend "java -Dfile.encodin…" 0 69.8MB 4 hours ago Up 4 hours server-backend
0bcf716ad266 server/flask "python -m app" 0 75.9kB 9 hours ago Up 9 hours peaceful_poincare
ec6a6ba85069 redis:latest "docker-entrypoint.s…" 1 970B 12 days ago Up 12 days server-redis
d45a7633117c server/sdwebui "/bin/sh -c './webui…" 0 1.52MB 13 days ago Up 13 days server-sdwebui
b4f0930a3620 server/jenkins "/usr/bin/tini -- /u…" 0 2.68GB 2 weeks ago Up 2 weeks server-jenkins
Local Volumes space usage:
VOLUME NAME LINKS SIZE
frontend 0 986.1MB
99fbae4584bbc073085c13eb3521a2b8fc8e473e49d8e416bd0c2a0fad52d622 1 692B
Build cache usage: 0B
CACHE ID CACHE TYPE SIZE CREATED LAST USED USAGE SHARED
tedxqgtdxyuo regular 0B 3 weeks ago 3 weeks ago 1 true
o0ctbsb203zx regular 0B 3 weeks ago 3 weeks ago 1 true
rj7x1gryphqf regular 0B 3 weeks ago 3 weeks ago 1 true
lwkf9nf8n56i regular 0B 3 weeks ago 3 weeks ago 1 true
9xgrulsw4agg regular 0B 3 weeks ago 3 weeks ago 1 true
...
nasnj8zhsxh2 regular 0B 8 days ago 9 hours ago 26 true
jjsnpxdic89f regular 173MB 9 hours ago 9 hours ago 1 true
xu7sjqzi7lbr regular 0B 5 days ago 4 hours ago 50 true
u3han9rdyypr regular 1.53GB 4 hours ago 4 hours ago 1 true
ua8dcwafo6s4 regular 172MB 4 hours ago 4 hours ago 1 true