View Source Testcontainers.Container (testcontainers v1.11.6)
A struct with builder functions for creating a definition of a container.
Summary
Functions
Returns true
if term
is a valid check_image
, otherwise returns false
.
Gets the host port on the container for the given exposed port.
A constructor function to make it easier to construct a container
Check if the provided image is compatible with the expected default image.
Check if the provided image is compatible with the expected default image.
Adds authentication token for registries that require a login.
Sets whether the container should be automatically removed on exit.
Sets a file or the directory on the host machine to be mounted into a container.
Sets a volume to be mounted into a container on target path
Set the regular expression to check the image validity.
Sets a cmd to run when the container starts.
Sets an environment variable to the container.
Adds a port to be exposed on the container.
Adds multiple ports to be exposed on the container.
Adds a fixed port to be exposed on the container. This approach to managing ports is not recommended by Testcontainers. Use at your own risk.
Sets a label to apply to the container object in docker.
Sets a network mode to apply to the container object in docker.
Sets whether the container should be reused if it is already running.
Sets multiple waiting strategies for the container.
Sets a waiting strategy for the container.
Functions
Returns true
if term
is a valid check_image
, otherwise returns false
.
Gets the host port on the container for the given exposed port.
A constructor function to make it easier to construct a container
Check if the provided image is compatible with the expected default image.
Check if the provided image is compatible with the expected default image.
Raises:
ArgumentError when image isn't compatible.
Adds authentication token for registries that require a login.
Sets whether the container should be automatically removed on exit.
with_bind_mount(config, host_src, container_dest, options \\ "ro")
View SourceSets a file or the directory on the host machine to be mounted into a container.
with_bind_volume(config, volume, container_dest, read_only \\ false)
View SourceSets a volume to be mounted into a container on target path
Set the regular expression to check the image validity.
When using a string, it will compile it to a regular expression. If the compilation fails, it will raise a Regex.CompileError
.
Sets a cmd to run when the container starts.
Sets an environment variable to the container.
Adds a port to be exposed on the container.
Adds multiple ports to be exposed on the container.
Adds a fixed port to be exposed on the container. This approach to managing ports is not recommended by Testcontainers. Use at your own risk.
Sets a label to apply to the container object in docker.
Sets a network mode to apply to the container object in docker.
Sets whether the container should be reused if it is already running.
Sets multiple waiting strategies for the container.
Sets a waiting strategy for the container.