docker prune

x·2024년 1월 9일
post-thumbnail
# 중지된지 1시간 지난 컨테이너 제거
docker container prune --filter until=1h

#태그 없는 이미지 제거
docker rmi $(docker images -f "dangling=true" -q)

docker image prune

# 컨테이너에서 안쓰는 이미지 제거
docker image prune -a

# 안쓰는 볼륨 제거
docker volume prune

# 안쓰는 컨테이너, 네트워크, 볼륨, 이름 없는 이미지, 빌드 캐시 한번에 정리
docker system prune --volumes
| WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all anonymous volumes not used by at least one container
  - all dangling images
  - all dangling build cache

# 안쓰는 컨테이너, 네트워크, 볼륨, 이미지, 빌드 캐시 한번에 정리
docker system prune --volumes -a
| WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all anonymous volumes not used by at least one container
  - all images without at least one container associated to them
  - all build cache

0개의 댓글