mirror of
https://github.com/docker/docs.git
synced 2026-11-04 10:01:00 +00:00
Add highlighting to compose-file reference
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
3 files changed
+644
-460
No files matched your search
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
+631
-451
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user