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@v3 with summary: true (the default)
- Build a Docker image whose
Dockerfile defines ENTRYPOINT but no CMD
- 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
ENTRYPOINT only, no CMD
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.
Describe the Bug
The post-build summary step fails with exit code 5 when the built Docker image has a
nullConfig.Cmd(i.e. the image uses only anENTRYPOINTand noCMDinstruction). 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
nullConfig.Cmdgracefully and complete without error. Images that define only anENTRYPOINTare valid Docker images and should not cause the action to fail.Steps to Reproduce
cloudposse/github-action-docker-build-push@v3withsummary: true(the default)DockerfiledefinesENTRYPOINTbut noCMDScreenshots
Logs from the failing step:
The summary step runs
docker inspecton the built image and extracts fields withjq. The line responsible is:CMD=$(jq -r '.[0].Config.Cmd | join(" ")' inspect.json)When
Config.Cmdisnull,jqcannot applyjointo 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
cloudposse/github-action-docker-build-push@v3ubuntu-latestENTRYPOINTonly, noCMDAdditional Context
The image inspect output confirms
"Cmd": nullinConfig. This is valid per the Docker image spec —CMDis optional whenENTRYPOINTis set.