Skip to content

SSH-based DOCKER_HOST not supported #992

@Tranquility2

Description

@Tranquility2

Description

When using an SSH-based DOCKER_HOST (e.g. ssh://user@remote-host), testcontainers cannot connect to containers.

The Docker Python SDK rewrites SSH URLs internally to http+docker://ssh, losing the original hostname. DockerClient.host() then parses that rewritten URL and returns "ssh" instead of the actual remote hostname. This breaks get_container_host_ip(), get_exposed_port(), and any code that relies on the host address to reach containers.

Reproduction

export DOCKER_HOST="ssh://user@10.0.0.1"
python -c "from testcontainers.core.docker_client import DockerClient
print(DockerClient().host())"

Expected: 10.0.0.1

Actual: ssh

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions