Essential Docker Commands Cheat Sheet
A quick reference to the Docker commands you’ll use most often.
Images
docker pull nginx # download an image
docker images # list local images
docker rmi nginx # remove an image
docker build -t myapp . # build from a DockerfileContainers
docker run -d -p 80:80 --name web nginx # run detached
docker ps # running containers
docker ps -a # all containers
docker stop web # stop
docker start web # start
docker rm web # removeInspecting and debugging
docker logs -f web # follow logs
docker exec -it web bash # shell into a container
docker inspect web # detailed infoCleanup
docker system prune -a # remove unused images/containersCombine with Docker Compose for multi-container apps.