List of 20 docker commands and their use cases with examples.

  • docker pull – used to pull images from the docker repository(hub.docker.com)
  • docker run – used to create a container from an image
  • docker ps – used to list the running containers
  • docker ps -a – used to show all the running and exited containers
  • docker exec – used to access the running container
  • docker stop – stops a running container
  • docker kill – kills the container by stopping its execution immediately.
  • docker commit – creates a new image of an edited container on the local system
  • docker push – used to push an image to the docker hub repository
  • docker images – lists all the locally stored docker images
  • docker rm – used to delete a stopped container
  • docker rmi – used to delete an image from local storage
  • docker build – used to build an image from a specified docker file
  • docker stop – used to stop the container
  • docker restart – used restart the container
  • docker –version – used to get the currently installed version of docker
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x