Build images, run containers, and use Compose — the Docker commands you actually need. Tap to copy.
docker pull <image>Download an image from a registrydocker build -t <name> .Build an image from the Dockerfile heredocker imagesList local imagesdocker rmi <image>Remove an imagedocker run <image>Create and start a container from an imagedocker run -d -p 8080:80 <image>Run detached and map a portdocker psList running containersdocker ps -aList all containers, including stoppeddocker stop <id>Stop a running containerdocker rm <id>Remove a stopped containerdocker exec -it <id> bashOpen an interactive shell in a containerdocker logs -f <id>Stream a container's logsdocker compose upStart the services in docker-compose.ymldocker compose up -dStart services in the backgrounddocker compose downStop and remove the compose servicesdocker compose buildBuild or rebuild compose servicesdocker compose logs -fFollow logs for all servicesdocker system pruneRemove unused containers, networks and imagesdocker volume lsList volumesdocker network lsList networksThe core Docker loop is build an image, run a container, and ps to see what's running. Add docker exec -it <id> bash to get a shell inside a container and docker compose up -d to bring up a whole stack, and you've covered most day-to-day Docker.