[−][src]Trait testcontainers::Image
Represents a docker image.
Implementations are required to implement Default. The default instance of an Image
should have a meaningful configuration! It should be possible to run
the default
instance of an Image and get back a working container!
Associated Types
type Args: Default + IntoIterator
A type representing the arguments for an Image.
There are a couple of things regarding the arguments of images:
- Similar to the Default implementation of an Image, the Default instance of its arguments should be meaningful!
- Implementations should be conservative about which arguments they expose. Many times, users will either go with the default arguments or just override one or two. When defining the arguments of your image, consider that the whole purpose is to facilitate integration testing. Only expose those that actually make sense for this case.
Required Methods
fn descriptor(&self) -> String
The descriptor of the docker image.
This should return a full-qualified descriptor. Implementations are encouraged to include a tag that will not change (i.e. NOT latest) in order to prevent test code from randomly breaking because the underlying docker suddenly changed.
fn wait_until_ready<D>(&self, container: &Container<D, Self>) where
D: Docker,
D: Docker,
Blocks the current thread until the started container is ready.
This method is the 🍞 and butter of the whole testcontainers library. Containers are rarely instantly available as soon as they are started. Most of them take some time to boot up.
Implementations MUST block the current thread until the passed-in container is ready to be interacted with. The container instance provides access to logs of the container.
Most implementations will very likely want to make use of this to wait for a particular message to be emitted.
fn args(&self) -> Self::Args
Returns the arguments this instance was created with.
fn with_args(self, arguments: Self::Args) -> Self
Re-configures the current instance of this image with the given arguments.
Implementors
impl Image for BitcoinCore
[src]
impl Image for BitcoinCore
type Args = BitcoinCoreImageArgs
fn descriptor(&self) -> String
[src]
fn descriptor(&self) -> String
fn wait_until_ready<D>(&self, container: &Container<D, BitcoinCore>) where
D: Docker,
[src]
fn wait_until_ready<D>(&self, container: &Container<D, BitcoinCore>) where
D: Docker,
fn args(&self) -> <BitcoinCore as Image>::Args
[src]
fn args(&self) -> <BitcoinCore as Image>::Args
fn with_args(self, arguments: <BitcoinCore as Image>::Args) -> BitcoinCore
[src]
fn with_args(self, arguments: <BitcoinCore as Image>::Args) -> BitcoinCore
impl Image for ParityEthereum
[src]
impl Image for ParityEthereum
type Args = ParityEthereumArgs
fn descriptor(&self) -> String
[src]
fn descriptor(&self) -> String
fn wait_until_ready<D>(&self, container: &Container<D, ParityEthereum>) where
D: Docker,
[src]
fn wait_until_ready<D>(&self, container: &Container<D, ParityEthereum>) where
D: Docker,
fn args(&self) -> <ParityEthereum as Image>::Args
[src]
fn args(&self) -> <ParityEthereum as Image>::Args
fn with_args(self, arguments: <ParityEthereum as Image>::Args) -> ParityEthereum
[src]
fn with_args(self, arguments: <ParityEthereum as Image>::Args) -> ParityEthereum
impl Image for GanacheCli
[src]
impl Image for GanacheCli
type Args = GanacheCliArgs
fn descriptor(&self) -> String
[src]
fn descriptor(&self) -> String
fn wait_until_ready<D>(&self, container: &Container<D, GanacheCli>) where
D: Docker,
[src]
fn wait_until_ready<D>(&self, container: &Container<D, GanacheCli>) where
D: Docker,
fn args(&self) -> <GanacheCli as Image>::Args
[src]
fn args(&self) -> <GanacheCli as Image>::Args
fn with_args(self, arguments: <GanacheCli as Image>::Args) -> GanacheCli
[src]
fn with_args(self, arguments: <GanacheCli as Image>::Args) -> GanacheCli