Skip to main content
Detects misspelled or invalid Dockerfile instruction keywords.

Description

Dockerfile instructions must be one of the keywords recognized by BuildKit (FROM, RUN, COPY, ADD, WORKDIR, ENV, ARG, EXPOSE, LABEL, CMD, ENTRYPOINT, VOLUME, USER, SHELL, HEALTHCHECK, ONBUILD, STOPSIGNAL, MAINTAINER). A misspelled keyword (e.g., FORM, COPPY, WROKDIR) is silently treated as a comment by the parser, making the resulting image incorrect without any obvious error. This check catches typos early using Levenshtein distance and suggests the closest valid instruction when within edit distance 2. This is a fail-fast check: if any unknown instruction is found, linting aborts with exit code 4.

Examples

Bad

Output:

Good