New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to run tests inside a docker container themselves #129
Comments
Maybe look into the shiplift crate so you don't create a docker api client from scratch. |
Yes definitely! |
Thanks for the hint, will give it a spin then! |
This adds the `ip_address` method to `Docker` trait in order to to query the ip address of the spawned container. This is derived from a `docker inspect` call. This also introduces a new usage pattern when used from the host system: Rather than relying on a port mapping to the host, the target port can be directly queried by using the ip address of the container in the internal docker network. Note: This relies on the fact, that the default docker bridge network is configured for all involved containers. testcontainers#129
Hey,
the current approach of this library assumes that
cargo test
is executed on the host system running docker. For having a reproducible environment, it makes sense to run the tests themselves inside a docker container. To be able to have those tests spin up and access other containers, we'd need to:docker-cli
installed)docker inspect
has itMy proposed approach would be to create another
Client
and implement 2 and 3 as enumerated above. Obviously, to be able to use it, the library users needs to make sure 1 is properly set up.What do you think about this approach? Would you be willing to accept a PR implementing the above?
The text was updated successfully, but these errors were encountered: