Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add `--no-trunc` option to `docker stack deploy` for full error messages

未关闭
#6,225 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
docker, go
领域
cli

调研方向

从 docker stack deploy 的 CLI 入口点开始,将其输出处理与现有的 docker service ps --no-trunc 实现进行比较。跟踪部署状态和错误输出,然后验证新选项是否保留完整消息,以及相关的 CLI 测试是否通过。

由索引模型根据 Issue 内容生成。

描述

kind/feature status/0-triage
Description
Problem

When running docker stack deploy, deployment errors (especially scheduling constraint failures) are truncated in the CLI output. For example:

1/1: no suitable node (scheduling constraints not satisfied on 1 node; host-mod…
overall progress: 0 out of 1 tasks

This truncation makes it difficult to understand why a service could not be scheduled, as the most relevant part of the message is often cut off. This behavior appears to be hardcoded and does not respect terminal width or environment variables like COLUMNS.

Workarounds
  • Manually running docker service ps <service> --no-trunc after deployment
  • Inspecting tasks individually with docker inspect
  • Writing custom scripts to combine deployment and diagnostic commands

These add friction and delay in understanding deployment issues.

Proposal

Add a --no-trunc flag to docker stack deploy, similar to the one already available in docker service ps, which disables truncation of deployment status and error messages.

Other alternatives could include:

  • Respecting the actual terminal width or COLUMNS environment variable
  • Automatically disabling truncation when output is non-interactive (e.g. in CI pipelines)
  • Supporting full output when --verbose or --debug is enabled
Benefits
  • Immediate visibility into deployment failures without requiring follow-up commands
  • Better support for CI/CD pipelines where error visibility is critical
  • Makes docker stack deploy consistent with other CLI commands that support --no-trunc
Related
  • docker service ps already supports --no-trunc and behaves as expected
  • No current CLI flags exist to control truncation during stack deployment
主要语言
Go
星标
6.1k
派生
2.2k
平均合并
1 天 10 小时
30 天内合并 PR
47

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

docker/cli 的其他 Issue

查看 docker/cli 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。