Skip to content

richard-vu/docker-quick-start

Repository files navigation

Docker Command

  1. docker --version : Check docker version

Docker Images

  1. docker pull nameimage:tag : pull a image from dockerhub
  2. docker images : Show all images in docker
  3. docker run [imageName] : run a container
  4. docker rmi [imageName] : Remove a image
  5. docker rmi $(docker images -q) : Delete All images

Docker Container

  1. docker ps : Show all container is running
  2. docker ps -a : Show all container is running and stop
  3. docker start [containerId] : Start container when it is stop
  4. docker stop [containerId] : Start container when it is start
  5. docker restart [containerId] : Restart a container
  6. docker rm [containerId] : Remove a container when it is stop
  7. docker stop $(docker ps -a -q) : Stop all container is running
  8. docker rm $(docker ps -a -q) : Delete All container
  9. docker container attach containerid : Go to terminal container is running
  10. CTRL + P + Q : Exit terminal, but container is running
  11. docker history name_or_id_of_image : The history of container or images
  12. docker diff container-name-or-id : diff
  13. docker logs -f container-name-or-id : Log container
  14. docker stats container-name-or-id : Stats

Network in Docker

  1. docker network ls: Show all list networks
  2. docker network create --driver [driverOption] networkName : Create a network driverOption:
  • bridge
  • ...
  1. docker network disconnect : Disconnect a container from a network
  2. docker network inspect : Display detailed information on one or more networks
  3. docker network prune : Remove all unused networks
  4. docker network rm : Remove one or more networks

Docker Compose

  1. docker-compose up --build -d : run file docker-compose.yml
  2. docker-compose down : Stop and delete container

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •