Ability to run tests inside a docker container themselves
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:
- Be able to access the docker socket from within the container (and have
docker-cliinstalled) - Make sure the networking is properly set up, e.g. same docker network / bridging
- Ability to get the IP of the created container -->
docker inspecthas it
My 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?
Maybe look into the shiplift crate so you don't create a docker api client from scratch.
What do you think about this approach? Would you be willing to accept a PR implementing the above?
Yes definitely! That is the direction we would want to take this library in, we just didn't have any needs for it so far :) We would definitely accept a PR for this!
Maybe look into the shiplift crate so you don't create a docker api client from scratch.
Thanks for the hint, will give it a spin then!