load

suspend fun load(quiet: Boolean = false, body: ByteReadChannel): Result<Unit, ErrorResponse>

Loads images from a tar archive and consumes the complete progress response. HTTP 200 or a completed layer is not final success: Docker stream errors become an error Result. Callbacks are sequential and apply backpressure; callback exceptions and cancellation propagate. There is no implicit request/idle deadline. Cancelling closes the request without rolling back daemon work.

Return

Operation response on success, or the Docker error response. Transport failures and cancellation can throw.

Parameters

quiet

Ask Docker to suppress verbose load progress.

body

Tar archive channel consumed by this operation; retries require a fresh source.

Samples

docker.images.load(body = archive) { println(it.stream ?: it.status) }.getOrThrow()

suspend fun load(quiet: Boolean = false, body: ByteReadChannel, onProgress: suspend (ImageProgress<Unit>) -> Unit): Result<Unit, ErrorResponse>

Loads images from a tar archive and consumes the complete progress response. HTTP 200 or a completed layer is not final success: Docker stream errors become an error Result. Callbacks are sequential and apply backpressure; callback exceptions and cancellation propagate. There is no implicit request/idle deadline. Cancelling closes the request without rolling back daemon work.

Return

Operation response on success, or the Docker error response. Transport failures and cancellation can throw.

Parameters

quiet

Ask Docker to suppress verbose load progress.

body

Tar archive channel consumed by this operation; retries require a fresh source.

onProgress

Suspending callback invoked sequentially for each progress record. Fields can be absent; progress counts describe a layer rather than the whole operation. Use the returned Result to determine completion, not status text or a percentage.

Samples

docker.images.load(body = archive) { println(it.stream ?: it.status) }.getOrThrow()