This guide covers commonly used Docker commands for managing images, containers, and troubleshooting.
Download an image from Docker Hub (or another registry):
docker pull IMAGE_NAME
View all images available locally:
docker images
Run a new container from an image:
docker run IMAGE_NAME
Run a new container and access its environment interactively:
docker run -it IMAGE_NAME
Stop a container:
docker stop CONTAINER_NAME_OR_ID
Start an existing container:
docker start CONTAINER_NAME_OR_ID