This cheatsheet provides a collection of essential Docker CLI commands for building, managing, and troubleshooting containerized applications.
Command: Displays system-wide information about Docker.
docker info
Command: Shows the Docker version for both client and server.
docker version
Command: Builds an image from a Dockerfile.
docker build -t <image-name>:<tag> .
Command: Runs a container from an image.
docker run -d --name <container-name> <image-name>:<tag>
Command: Lists running containers.
docker ps
Command: Stops a running container.
docker stop <container-name>
Command: Removes a container.
docker rm <container-name>
Command: Lists available Docker images.
docker images
Command: Displays logs from a container.
docker logs <container-name>
Command: Runs a command in a running container.
docker exec -it <container-name> <command>