Skip to main content
Comments for build stages or arguments should follow the description format.

Description

Comments for build stages or arguments should follow the format: # <arg/stage name> <description>. If a comment is not intended to be a description, add an empty line or comment between the instruction and the comment. The --call=outline and --call=targets flags for the docker build command print descriptions for build targets and arguments. The descriptions are generated from Dockerfile comments that immediately precede the FROM or ARG instruction and that begin with the name of the build stage or argument.

Examples

Bad:
Good (empty line separating):
Good (proper description format):

Auto-fix

The fix inserts an empty line between the non-description comment and the instruction.

Reference