List of 20 docker commands and its use cases with example ?

-> docker –version
This command is used to get the currently installed version of docker
-> docker pull
This command is used to pull images from the docker repository
-> docker run
This command is used to create a container from an image
-> docker ps
This command is used to list the running containers
-> docker ps -a
This command is used to show all the running and exited containers
-> docker exec
This command is used to access the running container
-> docker stop
This command stops a running container
-> docker kill
This command kills the container by stopping its execution immediately
-> docker commit
This command creates a new image of an edited container on the local system
-> docker login
This command is used to login to the docker hub repository
-> docker push
This command is used to push an image to the docker hub repository
-> docker images
This command lists all the locally stored docker images
-> docker rm
This command is used to delete a stopped container
-> docker rmi
This command is used to delete an image from local storage
-> docker build
This command is used to build an image from a specified docker file
-> docker-compose restart
You want to restart a container with the service name or container name.
-> docker-compose logs
the service crashed on launch and you want to know why
-> docker-compose stop
You want to stop your container by service name or container name.

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