Skip to main content
ENV key=value should be used instead of the legacy ENV key value format.

Description

The correct format for declaring environment variables and build arguments in a Dockerfile is ENV key=value and ARG key=value, where the variable name and value are separated by an equals sign. Historically, Dockerfiles have also supported a space separator. This legacy format is deprecated.

Examples

Bad:
Good:
Bad:
Good:

Auto-fix

The fix replaces the whitespace-separated format with equals format. Quotes are added if the value contains spaces.

Reference