Bug: Summary step fails with "Cannot iterate over null" when image has no Cmd
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
Direzione di ricerca
Inizia dallo script di riepilogo che esegue docker inspect e dall’espressione jq che legge Config.Cmd; inspect.json e l’espressione non riuscita join(\" \") sono identificati nell’issue. Fai in modo che il riepilogo tolleri i campi array null, inclusi Config.Cmd ed eventualmente Config.Entrypoint, quindi verifica che un’immagine con ENTRYPOINT ma senza CMD venga completata correttamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Dockerfile
- Stelle
- 14
- Fork
- 15
- Merge medio
- 8h 45m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudposse/github-action-docker-build-push
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
cloudposse/github-action-docker-build-push#77 · 1 commento ·
-
triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
cloudposse/github-action-docker-build-push#57 · 3 reazioni ·
-
Dependency DashboardAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 20/100
Tutte le issue di cloudposse/github-action-docker-build-push
Issue simili
-
lens:agent lens:process process
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
thebristolsound/birdbrain#1771 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
area:ops priority:P2 type:chore
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
skaiy/wild_agentos#407 ·
I maintainer di solito rispondono entro 1 giorno
-
ci-install-db-tools stall-case tests flake: stalled apt-get can be killed before it logs its callApertaeffort:low model:light plan planner:opus-5-5 tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
component/test-automation work/tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bcgov/bc-wallet-mobile#4845 ·
I maintainer di solito rispondono entro 1 giorno