Skip to content

Debugging

Docker Compose

Command Description
docker compose up <Service...> Create and start one or more services in the foreground
docker compose up -d <Service...> Create and start one or more services in the background
docker compose down Stop and delete all services
docker compose build <Service...> Build one or more services
docker compose logs <Service...> Output the logs of one or more services
docker compose ps Show the running containers
docker compose top <Service...> List the running processes of one or more services
docker compose rm <Service...> Delete one or more services
docker compose exec <Service> <Command> Execute command in running container with TTY
docker compose exec -T <Service> <Command> Execute command in running container without TTY
docker compose run <Service> <Command> Start container and execute command

Docker (native)

Command Description
docker run <image> Start container in foreground
docker run -d <image> Start a container in the background (detached)
docker stop Stop a running container
docker rm Delete a stopped container
docker build . Build an image from the Dockerfile in the current folder
docker logs <container> Show logs of a container
docker ps Show running containers
docker top <container> List running processes of a container
docker exec -ti <container> sh Start interactive shell in container
docker exec -ti <container> sh -c "<command>" Run command from a shell in container
docker stats <container> Show resource utilization of a container
docker events <container> Show status events of a container
docker inspect <container> Show low-level information of a container
docker history <image> Show individual layers of an image