도커 용량 초과

docker 2024. 5. 28. 14:44

출처


https://ngela.tistory.com/90

https://shg-engineer.tistory.com/18

https://choco-life.tistory.com/41


https://choco-life.tistory.com/41

 

 

 

$ sudo bash -c 'du -sh /var/lib/docker/*'
2.2M    /var/lib/docker/buildkit
228K    /var/lib/docker/containers
4.0K    /var/lib/docker/engine-id
1.3M    /var/lib/docker/image
72K     /var/lib/docker/network
881M    /var/lib/docker/overlay2
0       /var/lib/docker/plugins
0       /var/lib/docker/runtimes
0       /var/lib/docker/swarm
0       /var/lib/docker/tmp
24K     /var/lib/docker/volumes
[ec2-user]$


$ df -Th
Filesystem       Type      Size  Used Avail Use% Mounted on
devtmpfs         devtmpfs  4.0M     0  4.0M   0% /dev
tmpfs            tmpfs     1.9G     0  1.9G   0% /dev/shm
tmpfs            tmpfs     766M  828K  765M   1% /run
/dev/nvme0n1p1   xfs       8.0G  3.8G  4.2G  48% /
tmpfs            tmpfs     1.9G     0  1.9G   0% /tmp
/dev/nvme0n1p128 vfat       10M  1.3M  8.7M  13% /boot/efi
tmpfs            tmpfs     383M     0  383M   0% /run/user/1000



$ du -h --max-depth=2
4.0K    ./.ssh
447M    ./market/market-docker
447M    ./market
136K    ./.docker/buildx
140K    ./.docker
8.0K    ./promtail
0       ./.config/procps
0       ./.config
447M    .



# du -hs *
40K     36b8eb11a99e9d22d719c2da652a266076cd96f7ead83f20648df07c2bd48580
649M    67372f8bc0510b890991bce2c70a39b1cd4a9d978b00cd9677687c2374b67c7a
48K     765b3adbc02abae7a2405979d6ec64d2a91fd5f265941f0fa6bbede54604c7a8











 



$ vi /etc/logrotate.d/docker



/var/lib/docker/containers/*/*.log {
  rotate 3
  daily
  compress
  missingok
  copytruncate
}

$ logrotate -fv /etc/logrotate.d/docker




 

vi /etc/docker/daemon.json

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m",
    "max-file": "5",
    "labels": "production_status",
    "env": "os,customer"
  }
}

'docker' 카테고리의 다른 글

docker-compse Elasticsearch 설치  (0) 2023.05.18
블로그 이미지

iesay

,