50 Most-Used Docker Commands

🐳 50 Most-Used Docker Commands with Interactive Emulator

Docker helps you build, share, and run applications in containers. This WordPress-ready guide combines a practical command table, an emulator, guided challenges, a visual canvas, and Dockerfile + Docker Compose practice without connecting to a real Docker daemon.

Learning note: emulator output is simulated for training. Real output can vary by Docker Engine version, operating system, image tags, local resources, Docker Desktop settings, registry permissions, and compose.yaml content.

🚀 Responsive Docker Emulator

Type a command, choose a suggestion, or click “Use in Emulator” from the table. The emulator shows simulated output, guided feedback, and visual movement across images, containers, volumes, networks, Dockerfile, and Compose services.

Challenge: run docker version to start your Docker session.
DOCKER WORKSPACE
RESOURCE SCOPE 0
docker-runbook.md0/13

Docker CLI

FREE challenges are available now. LITE, PRO, and PRO Plus will be available soon with more guided labs and deeper scoring.

Expected runbook commandsdocker version
Run the next command to receive guided feedback.
Run the next command to receive guided feedback.
Dockerfile used in this challenge
This challenge focuses on Docker CLI operations. Dockerfile and Compose examples appear in the last three FREE challenges.
compose.yaml used in this challenge
compose.yaml: This challenge focuses on Docker CLI operations. Dockerfile and Compose examples appear in the last three FREE challenges.
How Docker Compose uses it: This challenge focuses on Docker CLI operations. Dockerfile and Compose examples appear in the last three FREE challenges.
Docker Visual CanvasNo changes yet: run a command to move simulated Docker resources.
What is happening?Run a Docker command to see the emulator explain how images, containers, volumes, networks, Dockerfile, and Compose change.
WORKSPACE OUTPUTwaiting
$ Waiting for a Docker command...
Run a command to see simulated Docker output here.
$ Docker Emulator Ready
Tip: choose a command from the table and click "Use in Emulator".

On small screens, the table automatically becomes cards so content is not cut off.

#Command / ParameterDescriptionExampleActions
1docker versionShow Docker client and server version information.docker version
2docker infoDisplay system-wide Docker information.docker info
3docker loginAuthenticate to a container registry.docker login
4docker logoutLog out from a container registry.docker logout
5docker searchSearch Docker Hub for images.docker search nginx
6docker pullDownload an image from a registry.docker pull nginx:latest
7docker imagesList local images.docker images
8docker image inspectInspect image metadata.docker image inspect nginx:latest
9docker image historyShow the layer history of an image.docker image history nginx:latest
10docker tagCreate a new tag for an image.docker tag nginx:latest local-nginx:v1
11docker buildBuild an image from a Dockerfile.docker build -t demo-app:1.0 .
12docker build --no-cacheBuild an image without using cache.docker build --no-cache -t demo-app:clean .
13docker runCreate and run a container from an image.docker run hello-world
14docker run -dRun a container in detached mode.docker run -d --name web -p 8080:80 nginx:latest
15docker psList running containers.docker ps
16docker ps -aList all containers, including stopped ones.docker ps -a
17docker logsShow container logs.docker logs web
18docker logs -fFollow container logs in real time.docker logs -f web
19docker execRun a command inside a running container.docker exec -it web sh
20docker stopStop a running container.docker stop web
21docker startStart a stopped container.docker start web
22docker restartRestart a container.docker restart web
23docker rmRemove a stopped container.docker rm web
24docker rmiRemove a local image.docker rmi local-nginx:v1
25docker container pruneRemove stopped containers.docker container prune -f
26docker image prune -aRemove unused images.docker image prune -a -f
27docker volume createCreate a named volume.docker volume create app-data
28docker volume lsList Docker volumes.docker volume ls
29docker volume inspectInspect a volume.docker volume inspect app-data
30docker volume rmRemove a Docker volume.docker volume rm app-data
31docker network createCreate a Docker network.docker network create app-net
32docker network lsList Docker networks.docker network ls
33docker network inspectInspect a Docker network.docker network inspect app-net
34docker network connectConnect a container to a network.docker network connect app-net web
35docker network rmRemove a Docker network.docker network rm app-net
36docker cpCopy files between host and container.docker cp index.html web:/usr/share/nginx/html/index.html
37docker statsShow live resource usage statistics.docker stats --no-stream
38docker topDisplay running processes inside a container.docker top web
39docker inspectReturn low-level Docker object information.docker inspect web
40docker eventsMonitor Docker daemon events.docker events --since 10m
41docker compose versionShow Docker Compose version.docker compose version
42docker compose upCreate and start services from compose.yaml.docker compose up -d
43docker compose psList containers managed by Compose.docker compose ps
44docker compose logsShow service logs from Compose.docker compose logs -f
45docker compose execRun a command inside a Compose service container.docker compose exec web sh
46docker compose restartRestart Compose services.docker compose restart
47docker compose downStop and remove Compose containers and networks.docker compose down
48docker compose down -vStop Compose services and remove named volumes too.docker compose down -v
49docker compose buildBuild or rebuild Compose services.docker compose build --no-cache
50docker compose pullPull service images defined in compose.yaml.docker compose pull

🧠 Conclusion

This Docker emulator is ready. The FREE pack contains the active challenges now, while LITE, PRO, and PRO Plus are visible as upcoming expansion tiers for deeper labs, scoring, downloadable runbooks, and advanced Docker Compose scenarios.