$
학습 Linux 안내서
ko
XP:0
퀘스트 147Container Pilot
+240 XP

Inspecting Linux Containers (docker ps, logs, exec)

이 퀘스트를 위한 인터랙티브 터미널 시작→설치 불필요 • 브라우저에서 바로 실행

개념 및 개요

Docker encapsulates applications inside isolated Linux cgroups and namespaces (containers). As a DevOps engineer or sysadmin, troubleshooting containerized workloads requires inspecting running containers and executing commands within their namespaces.

- docker ps: Lists running containers, container IDs, images, uptime, and mapped network ports.
- docker logs : Streams standard output and error logs generated by the containerized service.
- docker exec -it : Executes an interactive or diagnostic command directly inside the container namespace.

Let's inspect our microservice container. Run docker ps to list active containers, fetch service logs with docker logs web-api, and query the health endpoint inside the container using docker exec -it web-api curl localhost:8080/health.

명령어 구문 참조

Command / SyntaxDescription
docker psList running containers and port mappings
docker logs web-apiInspect container output logs
docker exec -it web-api curl localhost:8080/healthExecute command inside running container

검증 목표

  • ○
    List containers with docker ps
  • ○
    Fetch container logs with docker logs web-api
  • ○
    Execute command inside container with docker exec

퀘스트를 완료할 준비가 되셨나요? 147?