Skip to main content

PG005: Inconsistent instruction casing

Info Best Practice

Why This Matters

Docker instructions are case-insensitive, but mixing uppercase and lowercase (e.g., FROM with run) creates an inconsistent, messy appearance. The Docker documentation and community convention is to use UPPERCASE for all instructions. Inconsistent casing makes the Dockerfile harder to scan and signals to reviewers that the file may not have been carefully maintained.

How to Fix

Use consistent uppercase for all Dockerfile instructions

Before (incorrect)

FROM node:20
run npm install
COPY . .

After (correct)

FROM node:20
RUN npm install
COPY . .

Rule Details

Rule Code
PG005
Severity
Info
Category
Best Practice

Related Rules