EnvContainerApi

Abstraction of container-related operations for virtualization frameworks.

In the context of this virtualization API, "containers" refer to instances of virtualized environments. Examples include Docker containers and Vagrant environments.

Parameters

RepT

Class representation for a container.

ImageT

Class representation for an image.

Functions

Link copied to clipboard
abstract suspend fun blockingWait(container: RepT, timeout: Duration = Duration.ofMinutes(30)): Int

Blocking waits until container has exit.

Link copied to clipboard
abstract suspend fun create(image: ImageT): RepT

Creates an instance of the virtualization environment.

Link copied to clipboard
abstract suspend fun exec(container: RepT)

Starts the container.

Link copied to clipboard
abstract suspend fun inspect(container: RepT): Any?
Link copied to clipboard
abstract suspend fun list(): List<RepT>

Lists all available containers by their representation.

Link copied to clipboard
abstract suspend fun log(container: RepT): ContainerLogger

Retrieves the logs for the container.

Link copied to clipboard
abstract suspend fun <T> readPath(container: RepT, path: Path, mapper: suspend (InputStream) -> T): Option<T>

Reads a path from the container environment into the host.

Link copied to clipboard
abstract suspend fun remove(container: RepT): Boolean

Removes the container.

Link copied to clipboard
abstract suspend fun writePath(container: RepT, inputStream: InputStream, path: Path)

Writes the content of an InputStream to the container.