Docker Commands
1) Run a container docker run <container id> 2) List all the running containers docker ps 3) List all the containers present docker ps—a 4) Stop the container docker stop <container id> Note: You can give just the first 3 letters of the container Ex: docker stop 98x 5) Remove the stopped container docker rm <container id> 6) List all the available images docker images 7) To pull a docker image docker pull <image name> 8) To check all the steps performed when the image was pulled docker history <image id> 9) Remove the images that are no longer used docker rmi <image name> 10) Run the container in detached mode docker run—d <image name> Ex: docker run —d ubuntu 11) Pull the image docker pull <image name> Ex: docker pull ubuntu 12) Execute command on a running container docker exec <container id> <command to be executed> 13) If you want a particular version of the image add the tag docker run <image name>:<version