diff --git a/frontend/dockerfile/docs/rules/legacy-key-value-format.md b/frontend/dockerfile/docs/rules/legacy-key-value-format.md index 32003b399c57..3008e3fb4878 100644 --- a/frontend/dockerfile/docs/rules/legacy-key-value-format.md +++ b/frontend/dockerfile/docs/rules/legacy-key-value-format.md @@ -36,3 +36,21 @@ FROM alpine ARG foo=bar ``` +❌ Bad: multi-line variable declaration with a space separator. + +```dockerfile +ENV DEPS \ + curl \ + git \ + make +``` + +✅ Good: use an equals sign and wrap the value in quotes. + +```dockerfile +ENV DEPS="\ + curl \ + git \ + make" +``` + diff --git a/frontend/dockerfile/linter/docs/LegacyKeyValueFormat.md b/frontend/dockerfile/linter/docs/LegacyKeyValueFormat.md index ccf8450bfe78..b54f3d8ea9dd 100644 --- a/frontend/dockerfile/linter/docs/LegacyKeyValueFormat.md +++ b/frontend/dockerfile/linter/docs/LegacyKeyValueFormat.md @@ -28,3 +28,21 @@ ARG foo bar FROM alpine ARG foo=bar ``` + +❌ Bad: multi-line variable declaration with a space separator. + +```dockerfile +ENV DEPS \ + curl \ + git \ + make +``` + +✅ Good: use an equals sign and wrap the value in quotes. + +```dockerfile +ENV DEPS="\ + curl \ + git \ + make" +```