def python_testcontainer_image() -> str:
    """Build an image with test containers python for DinD and DooD tests"""
    py_version = ".".join(map(str, sys.version_info[:2]))
    image_name = f"testcontainers-python:{py_version}"
    client = DockerClient()
    client.build(
        path=str(PROJECT_DIR),
        tag=image_name,
        rm=False,
        buildargs={"PYTHON_VERSION": py_version},
    )
    return image_name
Build an image with test containers python for DinD and DooD tests
core/tests/conftest.py