...

Text file src/github.com/docker/cli/docs/reference/commandline/network_rm.md

Documentation: github.com/docker/cli/docs/reference/commandline

     1# network rm
     2
     3<!---MARKER_GEN_START-->
     4Remove one or more networks
     5
     6### Aliases
     7
     8`docker network rm`, `docker network remove`
     9
    10### Options
    11
    12| Name            | Type | Default | Description                                |
    13|:----------------|:-----|:--------|:-------------------------------------------|
    14| `-f`, `--force` |      |         | Do not error if the network does not exist |
    15
    16
    17<!---MARKER_GEN_END-->
    18
    19## Description
    20
    21Removes one or more networks by name or identifier. To remove a network,
    22you must first disconnect any containers connected to it.
    23
    24## Examples
    25
    26### Remove a network
    27
    28To remove the network named 'my-network':
    29
    30```console
    31$ docker network rm my-network
    32```
    33
    34### Remove multiple networks
    35
    36To delete multiple networks in a single `docker network rm` command, provide
    37multiple network names or ids. The following example deletes a network with id
    38`3695c422697f` and a network named `my-network`:
    39
    40```console
    41$ docker network rm 3695c422697f my-network
    42```
    43
    44When you specify multiple networks, the command attempts to delete each in turn.
    45If the deletion of one network fails, the command continues to the next on the
    46list and tries to delete that. The command reports success or failure for each
    47deletion.
    48
    49## Related commands
    50
    51* [network disconnect ](network_disconnect.md)
    52* [network connect](network_connect.md)
    53* [network create](network_create.md)
    54* [network ls](network_ls.md)
    55* [network inspect](network_inspect.md)
    56* [network prune](network_prune.md)
    57* [Understand Docker container networks](https://docs.docker.com/network/)

View as plain text