I believe this is because this code assumes the presence of "bridge" https://github.com/testcontainers/testcontainers-python/blob/master/testcontainers/core/docker_client.py#L52 https://github.com/testcontainers/testcontainers-python/blob/master/testcontainers/core/docker_client.py#L48 which is not the case when the container runs in a specific docker network (possible to do via DockerContainer.with_kwargs)