attach

suspend fun attach(id: String, detachKeys: String? = null, logs: Boolean = false, stream: Boolean = false, stdin: Boolean = false, stdout: Boolean = false, stderr: Boolean = false): Result<ExecSession, ErrorResponse>

Attaches to the existing container process; it does not start a new shell. The caller owns the returned ExecSession. Collect its output once and close it if never collected. Cancellation/completion of output closes the raw connection. TTY framing follows the inspected container configuration.

Return

Owned interactive session, or the Docker error response.

Parameters

id

Container ID or name.

detachKeys

Docker detach key sequence; null uses the daemon default.

logs

Include existing output before any live output.

stream

Continue receiving live output.

stdin

Attach standard input.

stdout

Include standard output.

stderr

Include standard error.