Skip to content

Question: Should ComposeContainer in Testcontainers Python expose container info like in Java? #857

@VictorCavichioli

Description

@VictorCavichioli

What are you trying to do?

Hello! I've been using Testcontainers for Java, and we recently started using it for Python as well. I noticed that in Java, when you have a Docker Compose setup and retrieve a container by its service name, it's possible to use getContainerInfo (which we use in our Java projects), and with this method, I can see networks and their details, among other things.

I noticed that in Testcontainers for Python, the Docker Compose support doesn’t offer this. When I get a container from a compose setup by its service name, it returns a ComposeContainer, and this ComposeContainer doesn't provide as much information as the Java version. So, I have a few questions:

Is there an architectural decision in the Python project not to include this? For example, is it considered out of scope or something similar?

Is there any on going work to implement something similar?

Would this feature be well received by the community if it were implemented?

Runtime environment

Provide a summary of your runtime environment. Which operating system, python version, and docker version are you using?
What is the version of testcontainers-python you are using? You can run the following commands to get the relevant information.

Paste the results of the bash below

uname -a
echo "------"
docker info
echo "------"
poetry run python --version
echo "------"
poetry show --tree
paste-me-here

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions