티스토리 뷰

Docker를 사용하고 있으면 압니다 만 


\이미지를 만들거나 컨테이너를 시작하거나하고 점차 기록이 쓰레기처럼 쌓여갑니다. 


물론 필요한 경우도 있는데, 개발 도중이 필요하기도합니다. 


그 정리를 해주는 것이 Docker-Clean입니다. 


간단한 명령 Docker에 불필요한 자원을 정리 해줍니다.



Docker-Clean 사용법


Docker-Clean으로 이미지를 삭제합니다.



  1. $ docker-clean images
  2. No containers To clean!
  3. Cleaning images...
  4. Error: No such image or container: 178ab09fdd10
  5. Error: No such image or container: 178ab09fdd10
  6. Error: No such image or container: 518a026fd577



도움말입니다. 기본적으로 run 또는 all뿐만 좋을 것입니다.


  1. $ docker-clean --help
  2. Docker Clean Usage Options:
  3. -------------------------------
  4. -h or --help Opens this help menu
  5. -v or --version Prints the current docker-clean version
  6. Running without any options will remove dangling volumes and untagged images only.
  7. All of the options are option, and while they overlap they can all be run concurrently.
  8. NOTE: By default, created containers will always be included, see -d, --created.
  9. stop Stops and removes all containers, cleans dangling volumes, and networks
  10. images Removes all tagged and untagged images, stopped containers,
  11. dangling volumes, and networks
  12. run Removes all stopped containers, untagged images, dangling volumes, and networks
  13. all Stops and removes all containers, images, volumes and networks
  14. Additional Flag options:
  15. -H or --host Specifies the docker host to run against
  16. Useful for docker swarm maintenance
  17. ie: -H 127.0.0.1:4000
  18. -n or --dry-run Adding this additional flag will list items to be
  19. removed without executing any stopping or removing commands
  20. -s or --stop Stops all running containers
  21. -c or --containers Removes all stopped containers
  22. -i or --images Removes all untagged images
  23. -net or --networks Removes all empty Networks (all network cleans are only empty)
  24. -r or --restart Restarts the docker machine/daemon
  25. -d or --created By default, CREATED containers are set to be removed. Adding this
  26. flag will ensure that all created containers are not cleaned
  27. -t or --tagged Removes all tagged images
  28. -a or --all Stops and removes all Containers, Images, AND Restarts docker
  29. -l or --log Adding this as an additional flag will list all
  30. image, volume, and container deleting output



Docker-Clean 절대로 불필요한 설정이나 자원이 깨끗이 정리됩니다. 

dry-run을 사용하여 일단 삭제 된 것 같은 것을 확인하고 문제가 없으면 후 

자동으로 운용 할 수있을 것입니다. 

Docker를 사용하고 정기적으로 자원의 삭제를 실시하고 있던 분은 꼭 시험해 봅시다. 

Docker-Clean은 Docker 용 MIT License 오픈 소스 소프트웨어입니다.








댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
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
글 보관함