mirror of https://github.com/docker/docs.git
Add highlighting to compose-file reference
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
517644a5ca
commit
38423908d4
|
@ -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
|
> (for the 2.x series), extension fields are also allowed at the root
|
||||||
> of service, volume, network, config and secret definitions.
|
> of service, volume, network, config and secret definitions.
|
||||||
|
|
||||||
```none
|
```yaml
|
||||||
version: '3.4'
|
version: '3.4'
|
||||||
x-custom:
|
x-custom:
|
||||||
items:
|
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
|
For example, if you want several of your services to use the same logging
|
||||||
configuration:
|
configuration:
|
||||||
|
|
||||||
```none
|
```yaml
|
||||||
logging:
|
logging:
|
||||||
options:
|
options:
|
||||||
max-size: '12m'
|
max-size: '12m'
|
||||||
|
@ -34,7 +34,7 @@ logging:
|
||||||
|
|
||||||
You may write your Compose file as follows:
|
You may write your Compose file as follows:
|
||||||
|
|
||||||
```none
|
```yaml
|
||||||
version: '3.4'
|
version: '3.4'
|
||||||
x-logging:
|
x-logging:
|
||||||
&default-logging
|
&default-logging
|
||||||
|
@ -55,7 +55,7 @@ services:
|
||||||
It is also possible to partially override values in extension fields using
|
It is also possible to partially override values in extension fields using
|
||||||
the [YAML merge type](http://yaml.org/type/merge.html). For example:
|
the [YAML merge type](http://yaml.org/type/merge.html). For example:
|
||||||
|
|
||||||
```none
|
```yaml
|
||||||
version: '3.4'
|
version: '3.4'
|
||||||
x-volumes:
|
x-volumes:
|
||||||
&default-volume
|
&default-volume
|
||||||
|
|
|
@ -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
|
example, suppose the shell contains `POSTGRES_VERSION=9.3` and you supply this
|
||||||
configuration:
|
configuration:
|
||||||
|
|
||||||
db:
|
```yaml
|
||||||
image: "postgres:${POSTGRES_VERSION}"
|
db:
|
||||||
|
image: "postgres:${POSTGRES_VERSION}"
|
||||||
|
```
|
||||||
|
|
||||||
When you run `docker-compose up` with this configuration, Compose looks for the
|
When you run `docker-compose up` with this configuration, Compose looks for the
|
||||||
`POSTGRES_VERSION` environment variable in the shell and substitutes its value
|
`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
|
allows you to refer to environment variables that you don't want processed by
|
||||||
Compose.
|
Compose.
|
||||||
|
|
||||||
web:
|
```yaml
|
||||||
build: .
|
web:
|
||||||
command: "$$VAR_NOT_INTERPOLATED_BY_COMPOSE"
|
build: .
|
||||||
|
command: "$$VAR_NOT_INTERPOLATED_BY_COMPOSE"
|
||||||
|
```
|
||||||
|
|
||||||
If you forget and use a single dollar sign (`$`), Compose interprets the value
|
If you forget and use a single dollar sign (`$`), Compose interprets the value
|
||||||
as an environment variable and warns you:
|
as an environment variable and warns you:
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue