Repository navigation
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
0988a55 to
e51e230
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The documented CMD example contains an unsupported trailing comment that becomes part of the instruction, preventing it from launching node worker.js as intended.
1 open issue
What changed in this PR
Adds docker/no-duplicate-instructions to detect overridden CMD, ENTRYPOINT, and HEALTHCHECK instructions within each Docker build stage.
Changes:
- Reports all but the last occurrence of each tracked instruction, without autofixes.
- Registers the rule and enables it as an error in the recommended configuration.
- Adds rule tests, documentation, and a README entry.
| File | Description |
|---|---|
src/rules/no-duplicate-instructions.ts |
Implements stage-scoped duplicate detection. |
src/rules/no-duplicate-instructions.spec.ts |
Tests duplicate reporting and stage isolation. |
src/index.ts |
Registers and enables the rule in the recommended configuration. |
src/index.spec.ts |
Adds the rule to registration expectations. |
README.md |
Lists the new rule and its recommended severity. |
docs/rules/no-duplicate-instructions.md |
Documents behavior, examples, and prior art. |
Review effort: Balanced
a7fb730 to
d77dd65
Compare
fe1e218 to
9243528
Compare
9243528 to
8012acb
Compare
8012acb to
827f9c7
Compare
827f9c7 to
8d87141
Compare
8d87141 to
168274a
Compare
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Dockerfile instructions do not support trailing comments, so the comment became part of the CMD arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
168274a to
4c4912a
Compare

Adds
docker/no-duplicate-instructions, which mirrors hadolint DL4003 and DL4004: only the last CMD, ENTRYPOINT, or HEALTHCHECK in a stage takes effect.Behavior
"error".Registration
The rule is registered in
src/index.ts(therulesmap and the recommended config), the rule list insrc/index.spec.ts, and the README's Rules table.Documentation
Adds
docs/rules/no-duplicate-instructions.mdwith the standard sections: description, background, rule details with incorrect and correct examples, options, when not to use it, and prior art. The rule'smeta.docs.urlpoints at that file.Testing
tests/rule-docs.test.ts.136 tests total; build, lint, and format checks pass.
🤖 Generated with Claude Code
Stack created with GitHub Stacks CLI • Give Feedback 💬
Summary by CodeRabbit
CMD,ENTRYPOINT, orHEALTHCHECKinstructions when duplicates appear within the same Docker build stage. The final instruction of each type is not flagged, and checks are handled separately for each stage.