From 2efd2456d7d21432f35a8d1d2e96cb9e21c48624 Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Tue, 6 Nov 2018 16:02:54 -0800 Subject: [PATCH] Update docs for volume and networks about the changed behavior of the external key in newer versions of the format Signed-off-by: Joffrey F --- compose/compose-file/compose-file-v2.md | 12 ++++++++---- compose/compose-file/index.md | 16 ++++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/compose/compose-file/compose-file-v2.md b/compose/compose-file/compose-file-v2.md index 4585410da3..cf59a2a446 100644 --- a/compose/compose-file/compose-file-v2.md +++ b/compose/compose-file/compose-file-v2.md @@ -1420,8 +1420,10 @@ If set to `true`, specifies that this volume has been created outside of Compose. `docker-compose up` does not attempt to create it, and raises an error if it doesn't exist. -`external` cannot be used in conjunction with other volume configuration keys -(`driver`, `driver_opts`). +For version 2.0 of the format, `external` cannot be used in +conjunction with other volume configuration keys (`driver`, `driver_opts`, +`labels`). This limitation no longer exists for +[version 2.1](compose-versioning.md#version-21) and above. In the example below, instead of attempting to create a volume called `[projectname]_data`, Compose looks for an existing volume simply @@ -1593,8 +1595,10 @@ If set to `true`, specifies that this network has been created outside of Compose. `docker-compose up` does not attempt to create it, and raises an error if it doesn't exist. -`external` cannot be used in conjunction with other network configuration keys -(`driver`, `driver_opts`, `group_add`, `ipam`, `internal`). +For version 2.0 of the format, `external` cannot be used in conjunction with +other network configuration keys (`driver`, `driver_opts`, `ipam`, `internal`). +This limitation no longer exists for +[version 2.1](compose-versioning.md#version-21) and above. In the example below, `proxy` is the gateway to the outside world. Instead of attempting to create a network called `[projectname]_outside`, Compose diff --git a/compose/compose-file/index.md b/compose/compose-file/index.md index c34bd24b68..f40d6dbaeb 100644 --- a/compose/compose-file/index.md +++ b/compose/compose-file/index.md @@ -1956,14 +1956,16 @@ If set to `true`, specifies that this volume has been created outside of Compose. `docker-compose up` does not attempt to create it, and raises an error if it doesn't exist. -`external` cannot be used in conjunction with other volume configuration keys -(`driver`, `driver_opts`). +For version 3.3 and below of the format, `external` cannot be used in +conjunction with other volume configuration keys (`driver`, `driver_opts`, +`labels`). This limitation no longer exists for +[version 3.4](compose-versioning.md#version-34) and above. In the example below, instead of attempting to create a volume called `[projectname]_data`, Compose looks for an existing volume simply called `data` and mount it into the `db` service's containers. - version: '2' + version: '3' services: db: @@ -2207,15 +2209,17 @@ If set to `true`, specifies that this network has been created outside of Compose. `docker-compose up` does not attempt to create it, and raises an error if it doesn't exist. -`external` cannot be used in conjunction with other network configuration keys -(`driver`, `driver_opts`, `ipam`, `internal`). +For version 3.3 and below of the format, `external` cannot be used in +conjunction with other network configuration keys (`driver`, `driver_opts`, +`ipam`, `internal`). This limitation no longer exists for +[version 3.4](compose-versioning.md#version-34) and above. In the example below, `proxy` is the gateway to the outside world. Instead of attempting to create a network called `[projectname]_outside`, Compose looks for an existing network simply called `outside` and connect the `proxy` service's containers to it. - version: '2' + version: '3' services: proxy: