push

suspend fun push(name: String, tag: String? = null, platform: String? = null): Result<Unit, ErrorResponse>

Pushes a tagged image to its registry 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

name

Tagged repository reference including its registry, for example registry.example.com/team/app.

tag

Image tag; null leaves tag selection to Docker.

platform

Optional Docker platform selector, for example linux/amd64.

Samples

val repository = "registry.example.com/team/app"
docker.images.tag(localImage, repo = repository, tag = "latest").getOrThrow()
docker.images.push(repository, tag = "latest") { progress ->
    progress.aux?.let { println("${it.digest}: ${it.size} bytes") }
}.getOrThrow()

suspend fun push(name: String, tag: String? = null, platform: String? = null, onProgress: suspend (ImageProgress<ImagePushResult>) -> Unit): Result<Unit, ErrorResponse>

Pushes a tagged image to its registry 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

name

Tagged repository reference including its registry, for example registry.example.com/team/app.

tag

Image tag; null leaves tag selection to Docker.

platform

Optional Docker platform selector, for example linux/amd64.

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

val repository = "registry.example.com/team/app"
docker.images.tag(localImage, repo = repository, tag = "latest").getOrThrow()
docker.images.push(repository, tag = "latest") { progress ->
    progress.aux?.let { println("${it.digest}: ${it.size} bytes") }
}.getOrThrow()