在学习 docker 教程时,我在使用 docker stack deploy
命令部署堆栈时遇到了问题。我设法获得的有关错误的大部分信息来自运行 docker stack ps
命令,该命令显示一个带有错误列的表:
这不是很多信息,即使消息被截断以适合表格。我已经解决了最初的问题,但对于 future 我想知道:如何查看完整的错误消息?我将如何阅读日志?
最佳答案
你需要使用下面的命令来做同样的事情
docker stack ps --no-trunc
您也可以通过运行 --help
标志在命令帮助中找到它:
$ 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
关于docker - 如何查看来自 'docker stack ps' 的完整错误消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49479094/