ContainerConfig

izumi.distage.docker.model.Docker.ContainerConfig
final case class ContainerConfig[+Tag](image: String, registry: Option[String] = ..., ports: Seq[DockerPort], name: Option[String] = ..., env: ContainerEnvironment = ..., userTags: Map[String, String] = ..., cmd: Seq[String] = ..., entrypoint: Seq[String] = ..., cwd: Option[String] = ..., user: Option[String] = ..., mounts: Seq[Mount] = ..., networks: Set[ContainerNetwork[_]] = ..., reuse: DockerReusePolicy = ..., autoRemove: Boolean = ..., platform: Option[String] = ..., healthCheckInterval: FiniteDuration = ..., healthCheckMaxAttempts: Int = ..., pullTimeout: FiniteDuration = ..., pullAttempts: Int = ..., pullAttemptInitialSleep: FiniteDuration = ..., pullAttemptMaxSleep: FiniteDuration = ..., healthCheck: ContainerHealthCheck = ..., portProbeTimeout: FiniteDuration = ..., autoPull: Boolean = ..., files: Seq[ContainerFile] = ..., afterCreate: Seq[ContainerHook] = ...)

Parameters that define the behavior of this docker container, Will be interpreted by ContainerResource

Value parameters

afterCreate

Hooks run in order after the container is created and before it is started, after copying files. A container is reused only if it was created with hooks of identical reuse keys, files included, compared by a digest label; see ContainerHook.

autoPull

Pull the image if it does not exists before starting the container. default: true, should only be disabled if you absolutely must manage the image manually.

autoRemove

Enable autoremove flag (--rm) for spawned docker image, ensures prompt pruning of containers running to completion. Note: must be disabled if you want to use ContainerHealthCheck.exitCodeCheck

cmd

Entrypoint command to use

cwd

Working directory to use inside the docker container

entrypoint

Docker entrypoint to use

env

Setup environment variables visible inside docker container

files

Files and directories this JVM reads and copies into the container after creating it and before starting it, before the afterCreate hooks, so the container engine never needs access to the host path. Copies are owned by root, world-readable, and executable only when the source file is; modification times are not preserved. The files are read twice: once to compute the reuse digest and once into temporary tar files, which are deleted after copying; creation fails if the files changed in between.

healthCheck

The function to use to test if a container has started already, by default probes to check if all ports are open and proceeds if so.

healthCheckInterval

Sleep interval between healthChecks default: 1 second

image

Docker Image to use

mounts

Host paths mounted to Volumes inside the docker container

name

Name of the container, if left at None Docker will generate a random name

networks

Docker networks to connect this container to

portProbeTimeout

Sleep interval between port probes in the default healthCheck default: 200 milliseconds

ports

Ports to map on the docker container

pullAttemptInitialSleep

Initial exponential backoff sleep duration after failed attempt to download the image with docker pull. default: 1 seconds

pullAttemptMaxSleep

Max exponential backoff sleep duration after failed attempt to download the image with docker pull. default: 15 seconds

pullAttempts

Maximum number of attempts for docker pull. If pull unexpectedly failed will try again after exponential backoff sleep. default: 15

pullTimeout

Maximum amount of time to wait for docker pull to download the image default: 120 seconds

registry

Default Docker registry to use. If not specified will use Docker Hub Registry.

reuse

If true and ClientConfig#globalReuse is also true, keeps container alive after tests. If false, the container will be shut down. default: true

userTags

User defined container labels that used to differentiate between containers with the same name but with different configs

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def tcpPorts: Set[DockerPort]
def udpPorts: Set[DockerPort]

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product