withInstance

fun <R> withInstance(block: DockerClient.() -> R): R

Executes block using a new instance of DockerClient, automatically closing the client after the block has exited.