Docker notes

 Imp points:

  • docker images -a => It will show all the images even interediate that were used while building images using Dockerfile
  • docker ps -a =>  Only display container IDs of the running comtainers
  • If we change line in docker file then all the ones below that line will be reexecuted instead of making use of cache
  • docker stop $(docker ps -q) -> stops all running containers && docker rmi $(docker images -q) only removes images with proper repo and tag name.It will  not delete images used by running containers
  • docker rm $(docker ps -aq) -> removes all stopped containers, first stop container using above cmd
  • docker rmi $(docker images -aq) -> removes all images even intermediatory images created while building docker images and when we rebuild images with same tag, the old images have none as repositoty and tag value. Even these will be removed
  • The CMD values can be overriden while running the container.This is not possible with entry point
  • By default docker containers cannot reach other containers using names. If we create them under same network(using docker networking then they can communicate with each other using names)


Comments

Popular posts from this blog

Helm Charts