Code Inspection: Invalid spaces in ''key=value'' pair

Last modified: 13 May 2022

Configure inspections: Settings | Editor | Inspections

Show intention actions: Alt+Enter

Reports incorrect spacing for key-value pairs in ARG, ENV, and LABEL commands.

While it is not explicitly specified in the Dockerfile specification, some combinations of spacing for key-value pairs are not allowed. Docker build will fail after reaching the problem instruction.

Examples:

  • The ARG command does not allow any spaces around '='

  • ENV and LABEL do not allow spaces after '='

After the quick-fix is applied: