Description
Validates that the container image has a startup command defined (ENTRYPOINT or CMD) and uses exec form. Exec form is preferred over shell form because it avoids an intermediate shell process, ensures signals (e.g. SIGTERM) reach the real process directly, and eliminates unintended shell interpretation.Command Syntax
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--allow-shell-form | bool | false | Allow shell form for entrypoint or cmd without failing (optional) |
--output / -o | string | text | Output format: text or json |
--log-level | string | info | Log level (trace, debug, info, warn, error, fatal, panic) |
How It Works
Validation Rules
- Has Startup Command: At least one of ENTRYPOINT or CMD must be defined
- Exec Form Check: By default, shell form causes the check to fail
Shell Form Detection
The command detects shell form when:- The first element is
/bin/shor/bin/bash - The second element is
-c
With --allow-shell-form
When --allow-shell-form is set:
- Shell form is detected but the check passes
- Result details include
"shell-form-allowed": truefor transparency "exec-form": falseindicates shell form was detected
Usage Examples
Basic Usage
Allow Shell Form
JSON Output
OCI Layout
OCI Archive
Docker Archive
Example Output
Text Format (Success - Exec Form)
Text Format (Failure - Shell Form)
Text Format (Success - Shell Form Allowed)
Text Format (Failure - No Entrypoint)
JSON Format (Success)
JSON Format (Shell Form Detected, Allowed)
JSON Format (Failure)
Exit Codes
| Exit Code | Meaning | Example | |-----------|---------|---------|----------| | 0 | Valid entrypoint | Image has exec-form entrypoint or shell form with--allow-shell-form |
| 1 | Invalid entrypoint | No entrypoint/cmd defined, or shell form without --allow-shell-form |
| 2 | Execution error | Image not found, invalid arguments |
Why Exec Form is Preferred
Exec form advantages:- No intermediate shell process consuming resources
- Signals (SIGTERM, SIGKILL) reach the application process directly
- No shell interpretation of special characters
- Faster startup time
- Correct PID 1 process (important for proper signal handling)
- Shell process becomes PID 1, not your application
- Signals may not propagate correctly
- Unintended shell expansion of variables and wildcards
- Additional process overhead
Notes
- The check examines both
ENTRYPOINTandCMDfields in the image configuration. - At least one must be non-empty for the check to pass.
- When both are present, the check validates that neither uses shell form (unless
--allow-shell-formis set). - Shell form is detected by checking if the command array starts with
["/bin/sh", "-c", ...]or["/bin/bash", "-c", ...].