Add highlighting to compose-file reference

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-03-19 12:14:44 +01:00
parent 517644a5ca
commit 38423908d4
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
3 changed files with 644 additions and 460 deletions

View File

@ -8,7 +8,7 @@ your Compose file and their name start with the `x-` character sequence.
> (for the 2.x series), extension fields are also allowed at the root
> of service, volume, network, config and secret definitions.
```none
```yaml
version: '3.4'
x-custom:
items:
@ -24,7 +24,7 @@ inserted in your resource definitions using [YAML anchors](http://www.yaml.org/s
For example, if you want several of your services to use the same logging
configuration:
```none
```yaml
logging:
options:
max-size: '12m'
@ -34,7 +34,7 @@ logging:
You may write your Compose file as follows:
```none
```yaml
version: '3.4'
x-logging:
&default-logging
@ -55,7 +55,7 @@ services:
It is also possible to partially override values in extension fields using
the [YAML merge type](http://yaml.org/type/merge.html). For example:
```none
```yaml
version: '3.4'
x-volumes:
&default-volume

View File

@ -3,8 +3,10 @@ variable values from the shell environment in which `docker-compose` is run. For
example, suppose the shell contains `POSTGRES_VERSION=9.3` and you supply this
configuration:
db:
image: "postgres:${POSTGRES_VERSION}"
```yaml
db:
image: "postgres:${POSTGRES_VERSION}"
```
When you run `docker-compose up` with this configuration, Compose looks for the
`POSTGRES_VERSION` environment variable in the shell and substitutes its value
@ -47,9 +49,11 @@ dollar sign. This also prevents Compose from interpolating a value, so a `$$`
allows you to refer to environment variables that you don't want processed by
Compose.
web:
build: .
command: "$$VAR_NOT_INTERPOLATED_BY_COMPOSE"
```yaml
web:
build: .
command: "$$VAR_NOT_INTERPOLATED_BY_COMPOSE"
```
If you forget and use a single dollar sign (`$`), Compose interprets the value
as an environment variable and warns you:

File diff suppressed because it is too large Load Diff