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.
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)- A13% (5)
- B88% (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.
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.
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
Community Discussion
No community discussion yet for this question.