While following the docker tutorial, I ran into a problem while deploying a stack with the docker stack deploy
command. The most information on the error I managed to obtain was from running the docker stack ps
command, which displays a table with an Error column:
This is not a lot of information, even the message is truncated to fit in the table. I have already resolved the original problem but for the future I would like to know: how can I view the complete error message? How would I go about reading the logs?
When using the --format option, the stack ps command will either output the data exactly as the template declares or, when using the table directive, includes column headers as well.
This is a cluster management command, and must be executed on a swarm manager node. To learn about managers and workers, refer to the Swarm mode section in the documentation. For example uses of this command, refer to the examples section below.
The 'docker ps' is a Docker command to list the running containers by default; however, we can use different flags to get the list of other containers that are in stopped or exited status. We can also manipulate the output as per our requirement using flags.
You need to use below command for the same
docker stack ps --no-trunc
You can also find this in the command help by running the --help
flag:
$ docker stack ps --help Usage: docker stack ps [OPTIONS] STACK List the tasks in the stack Options: -f, --filter filter Filter output based on conditions provided --format string Pretty-print tasks using a Go template --no-resolve Do not map IDs to Names --no-trunc Do not truncate output -q, --quiet Only display task IDs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With