nerdexam
Docker

DCA · Question #143

You created a new service named 'http' and discover it is not registering as healthy. Will this command enable you to view the list of historical tasks for this service? Solution: 'docker service ps…

The correct answer is B. No. The docker service ps http command lists active and recently failed tasks for a Docker service but, by default, may not display a comprehensive historical list of all tasks without specific flags.

Submitted by kevin_r· Apr 18, 2026Container Orchestration

Question

You created a new service named 'http' and discover it is not registering as healthy. Will this command enable you to view the list of historical tasks for this service? Solution: 'docker service ps http'

Options

  • AYes
  • BNo

How the community answered

(40 responses)
  • A
    13% (5)
  • B
    88% (35)

Why each option

The `docker service ps http` command lists active and recently failed tasks for a Docker service but, by default, may not display a comprehensive historical list of all tasks without specific flags.

AYes

While `docker service ps` does show some historical task information, particularly failed ones, its default output is not guaranteed to be a complete historical record of all service tasks without specific flags.

BNoCorrect

The `docker service ps` command primarily displays currently running tasks and recently failed tasks by default, which are relevant for an unhealthy service. However, it often truncates output and does not necessarily show a complete, untruncated historical list of *all* tasks (including successfully completed or shutdown tasks) without using additional flags like `--no-trunc` or `--filter 'state=shutdown'`.

Concept tested: Docker service task listing and history limitations

Source: https://docs.docker.com/engine/reference/commandline/service_ps/

Topics

#Docker Swarm#Docker Services#Service Management#CLI

Community Discussion

No community discussion yet for this question.

Full DCA Practice