List of 20 docker commands and their use cases with examples.
Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!
We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!
Learn from Guru Rajesh Kumar and double your salary in just one year.
- 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