mirror of https://github.com/docker/docs.git
Merge pull request #20648 from dvdksn/compose-nw-driver-opt-example
compose: use real network driver_opts examples
This commit is contained in:
commit
ca7a7b9a03
|
@ -119,14 +119,13 @@ services:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
frontend:
|
frontend:
|
||||||
# Use a custom driver
|
# Specify driver options
|
||||||
driver: custom-driver-1
|
driver: bridge
|
||||||
backend:
|
|
||||||
# Use a custom driver which takes special options
|
|
||||||
driver: custom-driver-2
|
|
||||||
driver_opts:
|
driver_opts:
|
||||||
foo: "1"
|
com.docker.network.bridge.host_binding_ipv4: "127.0.0.1"
|
||||||
bar: "2"
|
backend:
|
||||||
|
# Use a custom driver
|
||||||
|
driver: custom-driver
|
||||||
```
|
```
|
||||||
|
|
||||||
Networks can be configured with static IP addresses by setting the [ipv4_address and/or ipv6_address](/reference/compose-file/services.md#ipv4_address-ipv6_address) for each attached network.
|
Networks can be configured with static IP addresses by setting the [ipv4_address and/or ipv6_address](/reference/compose-file/services.md#ipv4_address-ipv6_address) for each attached network.
|
||||||
|
|
|
@ -50,14 +50,13 @@ services:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
frontend:
|
frontend:
|
||||||
# Use a custom driver
|
# Specify driver options
|
||||||
driver: custom-driver-1
|
driver: bridge
|
||||||
backend:
|
|
||||||
# Use a custom driver which takes special options
|
|
||||||
driver: custom-driver-2
|
|
||||||
driver_opts:
|
driver_opts:
|
||||||
foo: "1"
|
com.docker.network.bridge.host_binding_ipv4: "127.0.0.1"
|
||||||
bar: "2"
|
backend:
|
||||||
|
# Use a custom driver
|
||||||
|
driver: custom-driver
|
||||||
```
|
```
|
||||||
|
|
||||||
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 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.
|
||||||
|
@ -80,16 +79,18 @@ For more information on drivers and available options, see [Network drivers](/en
|
||||||
### driver_opts
|
### driver_opts
|
||||||
|
|
||||||
`driver_opts` specifies a list of options as key-value pairs to pass to the driver. These options are
|
`driver_opts` specifies a list of options as key-value pairs to pass to the driver. These options are
|
||||||
driver-dependent. Consult the driver's documentation for more information.
|
driver-dependent.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
networks:
|
networks:
|
||||||
db-data:
|
frontend:
|
||||||
|
driver: bridge
|
||||||
driver_opts:
|
driver_opts:
|
||||||
foo: "bar"
|
com.docker.network.bridge.host_binding_ipv4: "127.0.0.1"
|
||||||
baz: 1
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Consult the [network drivers documentation](/engine/network/_index.md) for more information.
|
||||||
|
|
||||||
### attachable
|
### attachable
|
||||||
|
|
||||||
If `attachable` is set to `true`, then standalone containers should be able to attach to this network, in addition to services.
|
If `attachable` is set to `true`, then standalone containers should be able to attach to this network, in addition to services.
|
||||||
|
|
|
@ -563,7 +563,7 @@ dns_search:
|
||||||
{{< introduced compose 2.27.1 "/compose/release-notes.md#2271" >}}
|
{{< introduced compose 2.27.1 "/compose/release-notes.md#2271" >}}
|
||||||
|
|
||||||
`driver_opts` specifies a list of options as key-value pairs to pass to the driver. These options are
|
`driver_opts` specifies a list of options as key-value pairs to pass to the driver. These options are
|
||||||
driver-dependent. Consult the driver's documentation for more information.
|
driver-dependent.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
services:
|
services:
|
||||||
|
@ -571,10 +571,11 @@ services:
|
||||||
networks:
|
networks:
|
||||||
app_net:
|
app_net:
|
||||||
driver_opts:
|
driver_opts:
|
||||||
foo: "bar"
|
com.docker.network.bridge.host_binding_ipv4: "127.0.0.1"
|
||||||
baz: 1
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Consult the [network drivers documentation](/engine/network/_index.md) for more information.
|
||||||
|
|
||||||
### entrypoint
|
### entrypoint
|
||||||
|
|
||||||
`entrypoint` declares the default entrypoint for the service container.
|
`entrypoint` declares the default entrypoint for the service container.
|
||||||
|
|
Loading…
Reference in New Issue