Docker compose TestContainers:重用DockerComposeContainer中的网络以在其他GenericContainer中使用?

Docker compose TestContainers:重用DockerComposeContainer中的网络以在其他GenericContainer中使用?,docker-compose,testcontainers,docker-java,Docker Compose,Testcontainers,Docker Java,有一种方法: org.testcontainers.containers.GenericContainer#with network 我可以使用它使用TestContainers库生成具有相同网络的容器 但是DockerComposeContainer呢,首先我启动它,然后我想从中获得一个网络,并在生成以下GenericContainer时重用相同的网络 现在可能吗

有一种方法:

org.testcontainers.containers.GenericContainer#with network

我可以使用它使用TestContainers库生成具有相同网络的容器

但是DockerComposeContainer呢,首先我启动它,然后我想从中获得一个网络,并在生成以下GenericContainer时重用相同的网络

现在可能吗