At some point in the future testcontainers plans to split container definitions from actual running containers. We might be able to get ahead of this by using ContainerState rather than Container
Comment From: philwebb
Unfortunately I think this is quite hard to support with the way things are. I think we'd end up need classes like ContainerConnectionSource to support two generics (one for the state and one for the container). This end up adding a lot of complexity which ultimately can't be used at the moment since there is no real state/container split.
I think we should continue with things as they are and look at how we can adapt after the testcontainers changes are in.