×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Bash
Posted by: Roman Ignatov
Added: Nov 22, 2016 4:37 PM
Views: 8
Tags: console docker
  1. # This allows you to enter a running docker:
  2.  
  3. docker exec -it [container-id] bash
  4.  
  5. # Kill all running containers
  6. docker kill $(docker ps -q)
  7.  
  8. # Delete all stopped containers (including data-only containers)
  9. docker rm $(docker ps -a -q)
  10.  
  11. # Delete all 'untagged/dangling' (<none>) images
  12. docker rmi $(docker images -q -f dangling=true)
  13.  
  14. # Delete ALL images
  15. docker rmi $(docker images -q)
  16.  
  17.  
  18. # Fix brocken images, when force deleted right ones. It was fix for me when I got error on docker-compose up with error: "ERROR: No such image...."
  19. rm -rf /var/lib/docker/containers/*
  20. rm /var/lib/docker/linkgraph.db
  21. service docker restart
  22.