Bug: Summary step fails with "Cannot iterate over null" when image has no Cmd
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
調査の方向性
docker inspect を実行し、Config.Cmd を読み取る jq 式を使っているサマリースクリプトから始めます。inspect.json と失敗している式 join(\" \") は issue で特定されています。Config.Cmd や、場合によっては Config.Entrypoint を含む null の配列フィールドをサマリーが許容するようにし、その後、CMD なしで ENTRYPOINT を持つイメージが正常に完了することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Describe the Bug
The post-build summary step fails with exit code 5 when the built Docker image has a null Config.Cmd (i.e. the image uses only an ENTRYPOINT and no CMD instruction). The image builds and pushes successfully — the failure is entirely in the summary/reporting step, but it causes the whole job to be marked as failed.
Expected Behavior
The summary step should handle a null Config.Cmd gracefully and complete without error. Images that define only an ENTRYPOINT are valid Docker images and should not cause the action to fail.
Steps to Reproduce
- Use
cloudposse/github-action-docker-build-push@v3withsummary: true(the default) - Build a Docker image whose
DockerfiledefinesENTRYPOINTbut noCMD - Observe the workflow fail in the summary step after an otherwise successful build and push
Screenshots
Logs from the failing step:
jq: error (at inspect.json:83): Cannot iterate over null (null)
Process completed with exit code 5.
The summary step runs docker inspect on the built image and extracts fields with jq. The line responsible is:
CMD=$(jq -r '.[0].Config.Cmd | join(" ")' inspect.json)
When Config.Cmd is null, jq cannot apply join to a null value and exits with code 5.
The suggested fix is a // [] fallback:
CMD=$(jq -r '.[0].Config.Cmd // [] | join(" ")' inspect.json)
The same pattern should be applied to any other field in the summary script that assumes a non-null array (e.g. Config.Entrypoint).
Environment
- Action:
cloudposse/github-action-docker-build-push@v3 - Runner OS:
ubuntu-latest - Docker image: defines
ENTRYPOINTonly, noCMD
Additional Context
The image inspect output confirms "Cmd": null in Config. This is valid per the Docker image spec — CMD is optional when ENTRYPOINT is set.
- 主要言語
- Dockerfile
- スター
- 14
- フォーク
- 15
- 平均マージ
- 8時間 45分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudposse/github-action-docker-build-push のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
cloudposse/github-action-docker-build-push#77 · コメント 1 件 ·
-
triage
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
cloudposse/github-action-docker-build-push#57 · リアクション 3 件 ·
-
Dependency Dashboardオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 20/100
cloudposse/github-action-docker-build-push の issue をすべて見る
似ている issue
-
Deploy & Patch-issues opprettes ikke: create-pnd-issues.yml har feilet hver uke siden 2025-09-08オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Altinn/altinn-auth#4359 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
WingedGuardian/GENesis-AGI#3126 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
aws-samples/appmod-blueprints#972 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
WordPress/presence-api#807 ·
メンテナーはふだん 1 日以内に返信
-
lens:agent lens:process process
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
thebristolsound/birdbrain#1771 ·
メンテナーはふだん 1 日以内に返信