Skip to main content
Empty continuation lines are deprecated and will cause errors in future Dockerfile syntax versions.
PropertyValue
SeverityError
CategoryCorrectness
DefaultEnabled
Auto-fixYes (--fix)

Description

Support for empty continuation (\) lines has been deprecated and will generate errors in future versions of the Dockerfile syntax. Empty continuation lines are empty lines following a newline escape.

Examples

Bad:
FROM alpine
EXPOSE \

80
Good:
FROM alpine
EXPOSE \
# Port
80
Bad:
FROM alpine
RUN apk add \

    gnupg \

    curl
Good (empty lines removed):
FROM alpine
RUN apk add \
    gnupg \
    curl

Auto-fix

The fix removes empty continuation lines from multi-line commands.

Reference