Troubleshooting
Error response from daemon: No build stage in current context
The Dockerfile is malformed — commonly a missing or misspelled FROM as the first instruction.
The daemon validates syntax before executing, so fix the file and rebuild.
Cannot connect to the Docker daemon
The daemon is not running, or your user lacks permission. Check with docker info and
systemctl status docker; confirm your user is in the docker group.
Image pull fails with "not found"
Check spelling and the tag. If no tag is given, Docker assumes :latest, which may not exist for
that repository. docker search confirms whether the repository is real.
Port is already allocated
Another process or container holds the host port. Find it with docker ps and either stop it or
publish on a different host port.
docker exec returns an error
The container is paused or not running. docker unpause or docker start it first.
Container exits immediately
Its main process finished. A container lives only as long as PID 1. Check docker logs, and
confirm that CMD or ENTRYPOINT starts a long-running foreground process rather than a command
that returns.
Disk filling up
Images, stopped containers, build cache, and orphaned volumes all accumulate. Inspect with
docker system df, then reclaim:
docker container prune
docker image prune -a
docker volume prune
docker system prune -a --volumes # aggressive; removes everything unused