Library to programmatically test docker setups

I am currently developing a system, whichs infrastructure runs in docker. Is there a library which allows to test if the running docker containers and their config are correct?

For example I have a CLI, which allows to update the config of a docker service. I would like to have some library, (preferably in java) which makes this service config update via the CLI automagically testable. This includes

  1. Create the infrastructure from scratch (preferably inside of a single container using docker in docker)
  2. Check the initial state of the config
  3. Update the config using the CLI (this is not the problem)
  4. Check if the config is updated and let the test fail if that’s not the case.

I have already seen https://www.testcontainers.org/ but they just make you able to run single JUnit tests inside of containers and not test a whole infrastructure.

Do you know a good way of doing this or am I forced to develop a custom system using GitHub - docker-java/docker-java: Java Docker API Client?