PORT: 8080
TZ: utc
image: busybox
```
Items under `blkio_config.device_read_bps`, `blkio_config.device_read_iops`,
`blkio_config.device_write_bps`, `blkio_config.device_write_iops`, `devices` and
`volumes` are also treated as mappings where key is the target path inside the
container.
For example, the following input:
```yaml
services:
common:
image: busybox
volumes:
- common-volume:/var/lib/backup/data:rw
cli:
extends:
service: common
volumes:
- cli-volume:/var/lib/backup/data:ro
```
Produces the following configuration for the `cli` service. Note that the mounted path
now points to the new volume name and `ro` flag was applied.
```yaml
image: busybox
volumes:
- cli-volume:/var/lib/backup/data:ro
```
If the referenced service definition contains `extends` mapping, the items under it
are simply copied into the new merged definition. The merging process is then kicked
off again until no `extends` keys are remaining.
For example, the following input:
```yaml
services:
base:
image: busybox
user: root
common:
image: busybox
extends:
service: base
cli:
extends:
service: common
```
Produces the following configuration for the `cli` service. Here, `cli` services
gets `user` key from `common` service, which in turn gets this key from `base`
service.
```yaml
image: busybox
user: root
```
##### Sequences
The following keys should be treated as sequences: `cap_add`, `cap_drop`, `configs`,
`deploy.placement.constraints`, `deploy.placement.preferences`,
`deploy.reservations.generic_resources`, `device_cgroup_rules`, `expose`,
`external_links`, `ports`, `secrets`, `security_opt`.
Any duplicates resulting from the merge are removed so that the sequence only
contains unique elements.
For example, the following input:
```yaml
services:
common:
image: busybox
security_opt:
- label=role:ROLE
cli:
extends:
service: common
security_opt:
- label=user:USER
```
Produces the following configuration for the `cli` service.
```yaml
image: busybox
security_opt:
- label=role:ROLE
- label=user:USER
```
In case list syntax is used, the following keys should also be treated as sequences:
`dns`, `dns_search`, `env_file`, `tmpfs`. Unlike sequence fields mentioned previously,
duplicates resulting from the merge are not removed.
##### Scalars
Any other allowed keys in the service definition should be treated as scalars.
### `external_links`
`external_links` link service containers to services managed outside of your Compose application.
`external_links` define the name of an existing service to retrieve using the platform lookup mechanism.
An alias of the form `SERVICE:ALIAS` can be specified.
```yml
external_links:
- redis
- database:mysql
- database:postgresql
```
### `extra_hosts`
`extra_hosts` adds hostname mappings to the container network interface configuration (`/etc/hosts` for Linux).
#### Short syntax
Short syntax uses plain strings in a list. Values must set hostname and IP address for additional hosts in the form of `HOSTNAME=IP`.
```yml
extra_hosts:
- "somehost=162.242.195.82"
- "otherhost=50.31.209.229"
- "myhostv6=::1"
```
IPv6 addresses can be enclosed in square brackets, for example:
```yml
extra_hosts:
- "myhostv6=[::1]"
```
The separator `=` is preferred, but `:` can also be used. Introduced in Docker Compose version [2.24.1](/manuals/compose/releases/release-notes.md#2241). For example:
```yml
extra_hosts:
- "somehost:162.242.195.82"
- "myhostv6:::1"
```
#### Long syntax
Alternatively, `extra_hosts` can be set as a mapping between hostname(s) and IP(s)
```yml
extra_hosts:
somehost: "162.242.195.82"
otherhost: "50.31.209.229"
myhostv6: "::1"
```
Compose creates a matching entry with the IP address and hostname in the container's network
configuration, which means for Linux `/etc/hosts` get extra lines:
```console
162.242.195.82 somehost
50.31.209.229 otherhost
::1 myhostv6