Doc that for 2.1+, overlay networks are attachable (#5967)

This commit is contained in:
Misty Stanley-Jones 2018-02-08 15:58:45 -08:00 committed by GitHub
parent 1fae41d59b
commit d14a9f96fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -1444,6 +1444,10 @@ The Docker Engine returns an error if the driver is not available.
driver: overlay
Starting in Compose file format 2.1, overlay networks are always created as
`attachable`, and this is not configurable. This means that standalone
containers can connect to overlay networks.
### driver_opts
Specify a list of options as key-value pairs to pass to the driver for this

View File

@ -39,6 +39,15 @@ When you run `docker-compose up`, the following happens:
3. A container is created using `db`'s configuration. It joins the network
`myapp_default` under the name `db`.
> **In v2.1+, overlay networks are always `attachable`**
>
> Starting in Compose file format 2.1, overlay networks are always created as
> `attachable`, and this is not configurable. This means that standalone
> containers can connect to overlay networks.
>
> In Compose file format 3.x, you can optionally set the `attachable` property
> to `false`.
Each container can now look up the hostname `web` or `db` and
get back the appropriate container's IP address. For example, `web`'s
application code could connect to the URL `postgres://db:5432` and start