Skip to content

Commit

Permalink
Merge pull request #5126 from dvdksn/docs-improve-LegacyKeyValueFormat
Browse files Browse the repository at this point in the history
docs: add a multi-line ENV example
  • Loading branch information
tonistiigi authored Jul 9, 2024
2 parents 0b1a789 + 465c933 commit 7950fa4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions frontend/dockerfile/docs/rules/legacy-key-value-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```

18 changes: 18 additions & 0 deletions frontend/dockerfile/linter/docs/LegacyKeyValueFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```

0 comments on commit 7950fa4

Please sign in to comment.