Docker Commands Sheet
docker --version: It will show current version of docker.
docker pull: It will pull an image from repository (ECR) to local machine.
docker images: It will show all the docker image which are in repository.
docker rmi: It will remove an image.
docker history: It will tell history of the image.
docker build: You can create an image from Docker file.
docker tag: It will tag image with name.
docker rename: It will rename the container.
docker run:*It will run and start container in one task.*
docker rm: It will delete the container.
docker run --rm:*It will remove the container once it stops.*
docker start: It will start a container, so it is running.
docker stop: It will stop a running container.
docker restart: It stops and starts a container.
docker kill: It kills a running container.
docker exec:*If you want to execute the command in container, you can run with the help of this command.*
docker ps : It will display the running containers.
docker ps -a : It will display the running and stopped containers.
docker logs : Provide the logs from the container.
docker inspect: It checks all the information on a container (including IP address).
docker top : It will display the running processes in the container.
docker info : It will display system-wide information about docker.
docker help : It will display detailed information about every other docker command.