Testcontainers-rs is the official Rust language fork of http://testcontainers.org.
TL:DR: Depend on
testcontainers, this will give you everything you need.
Check the integration tests on how to use the library.
The repository is structured into the several crates.
core: Contains the core traits and structs necessary for the testcontainers ecosystem.
cli_client: Contains an implementation of the
Dockertrait that uses the
docker-CLI to issue commands.
- The folder
imagescontains several crates named after the respective docker image. Each crate adds support for one particular image. This allows to selectively import the images you need.
Last but not least:
testcontainers: This is a meta crate that bundles all these crates together for convenient usage.
To not make it too inconvenient, the meta crate
testcontainers cannot strictly follow semver.
Thus you are encouraged to at least depend on the minor version of the library, i.e.
If you are interested in this crate versioning approach, checkout the release guide.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
While developing, please make sure that your code is formatted using
You can easily do that by using the pre-defined
git config core.hookspath .githooks
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.