docker network
NetworkCLI
connect
connect(network, container, alias=None, driver_options=[], ip=None, ip6=None, links=[])
Connect a container to a network
PARAMETER | DESCRIPTION |
---|---|
network |
The network to connect to
TYPE:
|
container |
The container to connect
TYPE:
|
alias |
Add network-scoped alias for the container
TYPE:
|
driver_options |
Driver options for the network
TYPE:
|
ip |
IPv4 address (e.g.,
TYPE:
|
ip6 |
IPv6 address (e.g.,
TYPE:
|
links |
Add links to other containers
TYPE:
|
create
create(name, attachable=False, driver=None, gateway=None, subnet=None, labels={}, options=[])
Creates a Docker network.
PARAMETER | DESCRIPTION |
---|---|
name |
The name of the network
TYPE:
|
Returns
A `python_on_whales.Network`.
disconnect
disconnect(network, container, force=False)
Disconnect a container from a network
PARAMETER | DESCRIPTION |
---|---|
network |
The name of the network.
TYPE:
|
container |
The container to disconnect.
TYPE:
|
exists
exists(network)
Check if a network exists
PARAMETER | DESCRIPTION |
---|---|
network |
The name of the network.
TYPE:
|
inspect
inspect(x)
Returns a python_on_whales.Network
object from a string (id or network name).
PARAMETER | DESCRIPTION |
---|---|
x |
One id or network name or a list of ids or network names.
TYPE:
|
Returns
One or a list of `python_on_whales.Network`.
list
list(filters={})
List all the networks available.
PARAMETER | DESCRIPTION |
---|---|
filters |
Filters as strings or list of strings.
TYPE:
|
Returns
List of `python_on_whales.Network`.
prune
prune(filters={})
Remove Docker networks which are not used by any containers.
PARAMETER | DESCRIPTION |
---|---|
filters |
Filters as strings or list of strings.
TYPE:
|
remove
remove(networks)
Removes a Docker network
PARAMETER | DESCRIPTION |
---|---|
networks |
One or more networks.
TYPE:
|