github.com/flavio/docker@v0.1.3-0.20170117145210-f63d1a6eec47/docs/reference/commandline/network_prune.md (about)

     1  ---
     2  title: "network prune"
     3  description: "Remove unused networks"
     4  keywords: "network, prune, delete"
     5  ---
     6  
     7  # network prune
     8  
     9  ```markdown
    10  Usage:	docker network prune [OPTIONS]
    11  
    12  Remove all unused networks
    13  
    14  Options:
    15        --filter filter   Provide filter values (e.g. 'until=<timestamp>')
    16    -f, --force           Do not prompt for confirmation
    17        --help            Print usage
    18  ```
    19  
    20  Remove all unused networks. Unused networks are those which are not referenced by any containers.
    21  
    22  Example output:
    23  
    24  ```bash
    25  $ docker network prune
    26  WARNING! This will remove all networks not used by at least one container.
    27  Are you sure you want to continue? [y/N] y
    28  Deleted Networks:
    29  n1
    30  n2
    31  ```
    32  
    33  ## Filtering
    34  
    35  The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more
    36  than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`)
    37  
    38  The currently supported filters are:
    39  
    40  * until (`<timestamp>`) - only remove networks created before given timestamp
    41  
    42  The `until` filter can be Unix timestamps, date formatted
    43  timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
    44  relative to the daemon machine’s time. Supported formats for date
    45  formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
    46  `2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local
    47  timezone on the daemon will be used if you do not provide either a `Z` or a
    48  `+-00:00` timezone offset at the end of the timestamp.  When providing Unix
    49  timestamps enter seconds[.nanoseconds], where seconds is the number of seconds
    50  that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
    51  seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
    52  fraction of a second no more than nine digits long.
    53  
    54  The following removes networks created more than 5 minutes ago. Note that
    55  system networks such as `bridge`, `host`, and `none` will never be pruned:
    56  
    57  ```bash
    58  $ docker network ls
    59  NETWORK ID          NAME                DRIVER              SCOPE
    60  7430df902d7a        bridge              bridge              local
    61  ea92373fd499        foo-1-day-ago       bridge              local
    62  ab53663ed3c7        foo-1-min-ago       bridge              local
    63  97b91972bc3b        host                host                local
    64  f949d337b1f5        none                null                local
    65  
    66  $ docker network prune --force --filter until=5m
    67  Deleted Networks:
    68  foo-1-day-ago
    69  
    70  $ docker network ls
    71  NETWORK ID          NAME                DRIVER              SCOPE
    72  7430df902d7a        bridge              bridge              local
    73  ab53663ed3c7        foo-1-min-ago       bridge              local
    74  97b91972bc3b        host                host                local
    75  f949d337b1f5        none                null                local
    76  ```
    77  
    78  ## Related information
    79  
    80  * [network disconnect ](network_disconnect.md)
    81  * [network connect](network_connect.md)
    82  * [network create](network_create.md)
    83  * [network ls](network_ls.md)
    84  * [network inspect](network_inspect.md)
    85  * [network rm](network_rm.md)
    86  * [Understand Docker container networks](https://docs.docker.com/engine/userguide/networking/)
    87  * [system df](system_df.md)
    88  * [container prune](container_prune.md)
    89  * [image prune](image_prune.md)
    90  * [volume prune](volume_prune.md)
    91  * [system prune](system_prune.md)