Skip to content

Commit 610f699

Browse files
authored
Merge pull request #23633 from meonkeys/yaml-ish-envfile
document yaml-ish .env file syntax and spacing rules
1 parent fa1b514 commit 610f699

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

content/manuals/compose/how-tos/environment-variables/variable-interpolation.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,13 @@ The following syntax rules apply to environment files:
130130
- Blank lines are ignored.
131131
- Unquoted and double-quoted (`"`) values have interpolation applied.
132132
- Each line represents a key-value pair. Values can optionally be quoted.
133+
- Delimiter separating key and value can be either `=` or `:`.
134+
- Spaces before and after value are ignored.
133135
- `VAR=VAL` -> `VAL`
134136
- `VAR="VAL"` -> `VAL`
135137
- `VAR='VAL'` -> `VAL`
138+
- `VAR: VAL` -> `VAL`
139+
- `VAR = VAL ` -> `VAL` <!-- markdownlint-disable-line no-space-in-code -->
136140
- Inline comments for unquoted values must be preceded with a space.
137141
- `VAR=VAL # comment` -> `VAL`
138142
- `VAR=VAL# not a comment` -> `VAL# not a comment`

content/reference/compose-file/services.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,13 @@ Each line in an `.env` file must be in `VAR[=[VAL]]` format. The following synta
688688
- Blank lines are ignored.
689689
- Unquoted and double-quoted (`"`) values have [Interpolation](interpolation.md) applied.
690690
- Each line represents a key-value pair. Values can optionally be quoted.
691+
- Delimiter separating key and value can be either `=` or `:`.
692+
- Spaces before and after value are ignored.
691693
- `VAR=VAL` -> `VAL`
692694
- `VAR="VAL"` -> `VAL`
693695
- `VAR='VAL'` -> `VAL`
696+
- `VAR: VAL` -> `VAL`
697+
- `VAR = VAL ` -> `VAL` <!-- markdownlint-disable-line no-space-in-code -->
694698
- Inline comments for unquoted values must be preceded with a space.
695699
- `VAR=VAL # comment` -> `VAL`
696700
- `VAR=VAL# not a comment` -> `VAL# not a comment`

0 commit comments

Comments
 (0)