Labs ICT
โญ Pro Login

Container Status and Logs

Monitoring containers with logs, ps, and inspect

Monitoring Containers

Once a container is running, you need to check its status, view logs, and inspect its configuration.

Container Commands

80/tcp   web

  List ALL containers (including stopped):
  $ docker ps -a

  View logs:
  $ docker logs web
  $ docker logs -f web              Follow logs in real-time
  $ docker logs --tail 100 web      Last 100 lines

  Inspect container details:
  $ docker inspect web              JSON with all container config
  $ docker inspect --format='{{.NetworkSettings.IPAddress}}' web

Container States

Resource Usage

๐Ÿงช Quick Quiz

How do you view logs from a Docker container?