Volumes

class Volumes(dockerClient: DockerClient)

Docker volumes operations using the owning DockerClient.

Result-returning methods report daemon HTTP errors as ErrorResponse. Transport/decoding failures and cancellation can throw. Live flows report request failures during collection.

Constructors

Link copied to clipboard
constructor(dockerClient: DockerClient)

Functions

Link copied to clipboard
suspend fun create(config: VolumeCreateOptions = VolumeCreateOptions()): Result<Volume, ErrorResponse>

Create a volume

Link copied to clipboard
suspend fun getInfo(name: String): Result<Volume, ErrorResponse>

Inspect a volume

Link copied to clipboard
suspend fun getList(filters: Map<String, List<String>>? = null): Result<VolumeListResponse, ErrorResponse>

List volumes

Link copied to clipboard
suspend fun prune(filters: Map<String, List<String>>? = null): Result<VolumePruneResponse, ErrorResponse>

Deletes unused volumes selected by Docker and the supplied filters. This can destroy persistent data.

Link copied to clipboard
suspend fun remove(name: String, force: Boolean = false): Result<Unit, ErrorResponse>

Deletes a volume and its persistent data. Invoke only for an explicit data-deletion action. Container removal does not require deleting its named volumes.