빨간색 에러들

[docker] docker system purne

vhxpffltm 2021. 9. 27. 21:49

도커를 사용하다 보면 뭔가 느려지거나 무거워진? 그런 오류가 있을 수 있다.

 

삭제를 아무리해도 캐시 등의 정보를 제거해줄 필요가 있다.

 

아래의 커맨드를 필자는 자주 사용한다.

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
//도커 실행 종료후 삭제
docker run --rm image_name
 
//중지된 컨테이너 사용하지 않는 이미지 전부 삭제
docker system prune -a
 
// 캐시 없이 빌드
docker build --no-cache -t u12_core -f u12_core .
 
 
//docker 오브젝트 전부 삭제
docker system prune --volumes
 
cs

 

https://docs.docker.com/engine/reference/commandline/system_prune/

 

docker system prune

docker system prune: Remove all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes.

docs.docker.com

 

https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes

 

How To Remove Docker Images, Containers, and Volumes | DigitalOcean

Docker doesn't provide direct cleanup commands, but it does give you all the tools you need to clean up your system from the command line. This cheat sheet-style guide provides a quick reference to commands that are useful for freeing disk space and k

www.digitalocean.com

 

https://stackoverflow.com/questions/35594987/how-to-force-docker-for-a-clean-build-of-an-image

 

How to force Docker for a clean build of an image

I have build a Docker image from a Docker file using the below command. $ docker build -t u12_core -f u12_core . When I am trying to rebuild it with the same command, it's using the build cache l...

stackoverflow.com