Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/reference/compose-file/merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ services:

In addition to the previously described mechanism, an override Compose file can also be used to remove elements from your application model.
For this purpose, the custom [YAML tag](https://yaml.org/spec/1.2.2/#24-tags) `!reset` can be set to
override a value set by the overriden Compose file. A valid value for attribute must be provided,
override a value set by the overridden Compose file. A valid value for attribute must be provided,
but will be ignored and target attribute will be set with type's default value or `null`.

For readability, it is recommended to explicitly set the attribute value to the null (`null`) or empty
Expand Down
34 changes: 34 additions & 0 deletions content/reference/compose-file/networks.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,40 @@ networks:

The advanced example shows a Compose file which defines two custom networks. The `proxy` service is isolated from the `db` service, because they do not share a network in common. Only `app` can talk to both.

## The default network

When a Compose file doesn't declare explicit networks, Compose uses an implicit `default` network. Services without an explicit [`networks`](services.md#networks) declaration are connected by Compose to this `default` network:


```yml
services:
some-service:
image: foo
```
This example is actually equivalent to:

```yml
services:
some-service:
image: foo
networks:
default: {}
networks:
default: {}
```

You can customize the `default` network with an explicit declaration:

```yml
networks:
default:
name: a_network # Use a custom name
driver_opts: # pass optionsto driver for network creation
com.docker.network.bridge.host_binding_ipv4: 127.0.0.1
```

For options, see the [Docker Engine docs](https://docs.docker.com/engine/network/drivers/bridge/#options).

## Attributes

### `driver`
Expand Down
42 changes: 38 additions & 4 deletions content/reference/compose-file/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,28 @@
```
For more information about the `networks` top-level element, see [Networks](networks.md).

### implicit default network

Check warning on line 1324 in content/reference/compose-file/services.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.HeadingSentenceCase] Use sentence case for headings: 'implicit default network'. Raw Output: {"message": "[Docker.HeadingSentenceCase] Use sentence case for headings: 'implicit default network'.", "location": {"path": "content/reference/compose-file/services.md", "range": {"start": {"line": 1324, "column": 5}}}, "severity": "WARNING"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### implicit default network
### `implicit default network`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my b. should be normal sentence case. have fixed!


If `networks` is empty or absent from the Compose file, Compose considers an implicit definition for the service to be
connected to the `default` network:

```yml
services:
some-service:
image: foo
```
This example is actually equivalent to:

```yml
services:
some-service:
image: foo
networks:
default: {}
```

If you want the service to not be connected a network, you must set [`network_mode: none`](#network_mode).

#### `aliases`

`aliases` declares alternative hostnames for the service on the network. Other containers on the same
Expand Down Expand Up @@ -1675,13 +1697,23 @@

`pull_policy` defines the decisions Compose makes when it starts to pull images. Possible values are:

* `always`: Compose always pulls the image from the registry.
* `never`: Compose doesn't pull the image from a registry and relies on the platform cached image.
- `always`: Compose always pulls the image from the registry.
- `never`: Compose doesn't pull the image from a registry and relies on the platform cached image.
If there is no cached image, a failure is reported.
* `missing`: Compose pulls the image only if it's not available in the platform cache.
- `missing`: Compose pulls the image only if it's not available in the platform cache.
This is the default option if you are not also using the [Compose Build Specification](build.md).
`if_not_present` is considered an alias for this value for backward compatibility.
* `build`: Compose builds the image. Compose rebuilds the image if it's already present.
- `build`: Compose builds the image. Compose rebuilds the image if it's already present.
- `daily`: Compose checks the registry for image updates if the last pull took place more than 24 hours ago.
- `weekly`: Compose checks the registry for image updates if the last pull took place more than 7 days ago.
- `every_<duration>`: Compose checks the registry for image updates if the last pull took place before `<duration>`. Duration can be expressed in weeks (`w`), days (`d`), hours (`h`), minutes (`m`), seconds (`s`) or a combination of these.

```yaml
services:
test:
image: nginx
pull_policy: every_12h
```

### `read_only`

Expand Down Expand Up @@ -1779,6 +1811,8 @@
The default value is world-readable permissions (mode `0444`).
The writable bit must be ignored if set. The executable bit may be set.

Note that support for `uid`, `gid`, and `mode` attributes are not implemented in Docker Compose when the source of the secret is a [`file`](secrets.md). This is because bind-mounts used under the hood don't allow uid remapping.

Check warning on line 1814 in content/reference/compose-file/services.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.RecommendedWords] Consider using 'let' instead of 'allow' Raw Output: {"message": "[Docker.RecommendedWords] Consider using 'let' instead of 'allow'", "location": {"path": "content/reference/compose-file/services.md", "range": {"start": {"line": 1814, "column": 208}}}, "severity": "INFO"}

The following example sets the name of the `server-certificate` secret file to `server.cert`
within the container, sets the mode to `0440` (group-readable), and sets the user and group
to `103`. The value of `server-certificate` is set
Expand Down