1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

update network ls docs to add SCOPE

Signed-off-by: erxian <evelynhsu21@gmail.com>
This commit is contained in:
erxian 2016-11-10 12:08:15 +08:00
parent a3b0ade346
commit 9410f4cc86

View file

@ -35,24 +35,24 @@ Lists all the networks the Engine `daemon` knows about. This includes the
networks that span across multiple hosts in a cluster, for example: networks that span across multiple hosts in a cluster, for example:
```bash ```bash
$ sudo docker network ls $ sudo docker network ls
NETWORK ID NAME DRIVER NETWORK ID NAME DRIVER SCOPE
7fca4eb8c647 bridge bridge 7fca4eb8c647 bridge bridge local
9f904ee27bf5 none null 9f904ee27bf5 none null local
cf03ee007fb4 host host cf03ee007fb4 host host local
78b03ee04fc4 multi-host overlay 78b03ee04fc4 multi-host overlay local
``` ```
Use the `--no-trunc` option to display the full network id: Use the `--no-trunc` option to display the full network id:
```bash ```bash
docker network ls --no-trunc $ docker network ls --no-trunc
NETWORK ID NAME DRIVER NETWORK ID NAME DRIVER SCOPE
18a2866682b85619a026c81b98a5e375bd33e1b0936a26cc497c283d27bae9b3 none null 18a2866682b85619a026c81b98a5e375bd33e1b0936a26cc497c283d27bae9b3 none null local
c288470c46f6c8949c5f7e5099b5b7947b07eabe8d9a27d79a9cbf111adcbf47 host host c288470c46f6c8949c5f7e5099b5b7947b07eabe8d9a27d79a9cbf111adcbf47 host host local
7b369448dccbf865d397c8d2be0cda7cf7edc6b0945f77d2529912ae917a0185 bridge bridge 7b369448dccbf865d397c8d2be0cda7cf7edc6b0945f77d2529912ae917a0185 bridge bridge local
95e74588f40db048e86320c6526440c504650a1ff3e9f7d60a497c4d2163e5bd foo bridge 95e74588f40db048e86320c6526440c504650a1ff3e9f7d60a497c4d2163e5bd foo bridge local
63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 dev bridge 63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 dev bridge local
``` ```
## Filtering ## Filtering
@ -78,9 +78,9 @@ The following example matches networks with the `bridge` driver:
```bash ```bash
$ docker network ls --filter driver=bridge $ docker network ls --filter driver=bridge
NETWORK ID NAME DRIVER NETWORK ID NAME DRIVER SCOPE
db9db329f835 test1 bridge db9db329f835 test1 bridge local
f6e212da9dfd test2 bridge f6e212da9dfd test2 bridge local
``` ```
#### ID #### ID
@ -92,20 +92,20 @@ The following filter matches all networks with an ID containing the
```bash ```bash
$ docker network ls --filter id=63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 $ docker network ls --filter id=63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161
NETWORK ID NAME DRIVER NETWORK ID NAME DRIVER SCOPE
63d1ff1f77b0 dev bridge 63d1ff1f77b0 dev bridge local
``` ```
You can also filter for a substring in an ID as this shows: You can also filter for a substring in an ID as this shows:
```bash ```bash
$ docker network ls --filter id=95e74588f40d $ docker network ls --filter id=95e74588f40d
NETWORK ID NAME DRIVER NETWORK ID NAME DRIVER SCOPE
95e74588f40d foo bridge 95e74588f40d foo bridge local
$ docker network ls --filter id=95e $ docker network ls --filter id=95e
NETWORK ID NAME DRIVER NETWORK ID NAME DRIVER SCOPE
95e74588f40d foo bridge 95e74588f40d foo bridge local
``` ```
#### Label #### Label
@ -117,17 +117,17 @@ The following filter matches networks with the `usage` label regardless of its v
```bash ```bash
$ docker network ls -f "label=usage" $ docker network ls -f "label=usage"
NETWORK ID NAME DRIVER NETWORK ID NAME DRIVER SCOPE
db9db329f835 test1 bridge db9db329f835 test1 bridge local
f6e212da9dfd test2 bridge f6e212da9dfd test2 bridge local
``` ```
The following filter matches networks with the `usage` label with the `prod` value. The following filter matches networks with the `usage` label with the `prod` value.
```bash ```bash
$ docker network ls -f "label=usage=prod" $ docker network ls -f "label=usage=prod"
NETWORK ID NAME DRIVER NETWORK ID NAME DRIVER SCOPE
f6e212da9dfd test2 bridge f6e212da9dfd test2 bridge local
``` ```
#### Name #### Name
@ -138,17 +138,17 @@ The following filter matches all networks with a name containing the `foobar` st
```bash ```bash
$ docker network ls --filter name=foobar $ docker network ls --filter name=foobar
NETWORK ID NAME DRIVER NETWORK ID NAME DRIVER SCOPE
06e7eef0a170 foobar bridge 06e7eef0a170 foobar bridge local
``` ```
You can also filter for a substring in a name as this shows: You can also filter for a substring in a name as this shows:
```bash ```bash
$ docker network ls --filter name=foo $ docker network ls --filter name=foo
NETWORK ID NAME DRIVER NETWORK ID NAME DRIVER SCOPE
95e74588f40d foo bridge 95e74588f40d foo bridge local
06e7eef0a170 foobar bridge 06e7eef0a170 foobar bridge local
``` ```
#### Type #### Type
@ -160,9 +160,9 @@ The following filter matches all user defined networks:
```bash ```bash
$ docker network ls --filter type=custom $ docker network ls --filter type=custom
NETWORK ID NAME DRIVER NETWORK ID NAME DRIVER SCOPE
95e74588f40d foo bridge 95e74588f40d foo bridge local
63d1ff1f77b0 dev bridge 63d1ff1f77b0 dev bridge local
``` ```
By having this flag it allows for batch cleanup. For example, use this filter By having this flag it allows for batch cleanup. For example, use this filter