Exit code reference
| Code | Name | Meaning |
|---|---|---|
0 | Success | No violations found, or all violations are below the configured --fail-level |
1 | Violations | One or more violations at or above the configured --fail-level |
2 | Error | Configuration, parse, or I/O error (for example: invalid config file, permission denied) |
3 | No files | No Dockerfiles to lint (missing file, empty glob, empty directory) |
4 | Syntax error | Dockerfile has fatal syntax issues (unknown instructions, malformed directives) |
How --fail-level affects exit code 1
By default, tally exits with code 1 when any violation at style severity or above is found. Use --fail-level to raise or lower that threshold:
error, warning, info, style (default), none.
Script examples
Basic check
Handling each exit code
Distinguish “nothing to lint” from real errors
Exit code3 lets you detect a missing or empty path separately from a configuration error (code 2):
Detect syntax errors before linting
CI: fail only on errors
CI/CD tips
- Use
--fail-level errorto allow warnings without blocking the build. - Use
--fail-level nonewhen uploading SARIF so the upload step always runs even when violations exist. - Exit code
3distinguishes “the path was wrong” from “the config is broken” (code2), useful in matrix CI jobs where not every service has a Dockerfile. - Exit code
4indicates the Dockerfile itself is malformed — fix those before addressing lint violations.