hadolint/DL3059¶
Multiple consecutive RUN instructions.
Superseded by
tally/prefer-run-heredoc, which provides the same check with enhanced detection (consecutive RUNs and chained commands) and auto-fix support using heredoc syntax.
Description¶
Multiple consecutive RUN instructions can be consolidated into a single instruction to reduce image layers.
Examples¶
Problematic code¶
Correct code¶
Or with heredoc syntax (tally auto-fix):