docker volume
VolumeCLI
clone
clone(source, new_volume_name=None, driver=None, labels={}, options={})
Clone a volume.
PARAMETER | DESCRIPTION |
---|---|
source |
The volume to clone
TYPE:
|
new_volume_name |
The new volume name. If not given, a random name is chosen.
TYPE:
|
driver |
Specify volume driver name (default "local")
TYPE:
|
labels |
Set metadata for a volume
TYPE:
|
options |
Set driver specific options
TYPE:
|
Returns
A `python_on_whales.Volume`, the new volume.
copy
copy(source, destination)
Copy files/folders between a volume and the local filesystem.
PARAMETER | DESCRIPTION |
---|---|
source |
If
TYPE:
|
destination |
Same as
TYPE:
|
create
create(volume_name=None, driver=None, labels={}, options={})
Creates a volume
PARAMETER | DESCRIPTION |
---|---|
volume_name |
The volume name, if not provided, a long random string will be used instead.
TYPE:
|
driver |
Specify volume driver name (default "local")
TYPE:
|
labels |
Set metadata for a volume
TYPE:
|
options |
Set driver specific options
TYPE:
|
exists
exists(x)
Returns True
if the volume exists. False
otherwise.
It's just calling docker.volume.inspect(...)
and verifies that it doesn't throw
a python_on_whales.exceptions.NoSuchVolume
.
Returns
A `bool`
list
list(filters={})
List volumes
PARAMETER | DESCRIPTION |
---|---|
filters |
See the Docker documentation page about filtering
.
An example
TYPE:
|
Returns
`List[python_on_whales.Volume]`
prune
prune(filters={}, all=False)
Remove volumes
PARAMETER | DESCRIPTION |
---|---|
filters |
See the Docker documentation page about filtering
.
An example
TYPE:
|
all |
Remove all unused volumes, not just anonymous ones.
TYPE:
|
remove
remove(x)
Removes one or more volumes
PARAMETER | DESCRIPTION |
---|---|
x |
A volume or a list of volumes. An empty list as argument means nothing is done.
TYPE:
|