Skip to main content

Documentation Index

Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt

Use this file to discover all available pages before exploring further.

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

FROM ubuntu
RUN apt-get update
RUN apt-get install -y curl

Correct code

FROM ubuntu
RUN apt-get update && apt-get install -y curl
Or with heredoc syntax (tally auto-fix):
FROM ubuntu
RUN <<EOF
apt-get update
apt-get install -y curl
EOF

Reference