Docker Guide
Docker Commands
To check if a Docker container is running,
Open Git Bash and run the following command to see all currently running containers:
docker psIf you want to see all containers (including those that have stopped or exited), add the -a flag:
docker ps -aHow to verify
If running: You will see a table output containing columns like
CONTAINER ID,IMAGE,COMMAND,CREATED,STATUS,PORTS, andNAMES. If your container appears in the list with a status starting withUp, it is running.If empty/not running: The table will only show the header row (or be completely empty), meaning no containers are currently running.
Common errors:
failed to connect to the docker API at npipe:////./pipe/dockerDesktopLinuxEngine; check if the path is correct and if the daemon is running: open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.
If the docker desktop is not running on windows, you will face the above error running docker ps command.
docker exec -it container_name bash
Use this command to open an interactive command-line session inside a running Docker container.