SHARE
TWEET

Untitled

a guest Sep 17th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. docker exec -it -u <use> <name_container> bash
  2. docker exec -it <name_container> bash //without user
  3. # enter a specific docker conteiner
  4.  
  5. docker-compose up -d
  6. # up all docker containers
  7.  
  8. docker-compose stop
  9. # stop all docker containers
  10.  
  11. docker rm <name_container>
  12. # remove a specific docker container
  13.  
  14. docker rm -f $(docker ps -a -q)
  15. docker rm -f $(docker ps -qa)
  16. # remove all containers
  17.  
  18. docker ps -a
  19. # list all docker containers with id, image (location), command, created, status, ports, names
  20.  
  21. docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
  22. # remove orphans images
  23.  
  24. docker rm $(docker ps -qa -f status=exited)
  25. # remove just of exited containers
  26.  
  27. docker rmi -f $(docker images | awk '{print $3, $8}')
  28. # remove all images
  29.  
  30. docker history my/image | awk 'NR>1 {print $1}' | xargs docker inspect --format '{{ ((index .ContainerConfig.Cmd ) 0) }}'
  31. # inspect an image
  32.  
  33. docker stop $(docker ps -q); docker rm $(docker ps -a -q); docker volume rm $(docker volume ls -q); docker rmi $(docker images -q); docker network rm $(docker network ls -q);
  34. docker command to clear all
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top