You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature: auto-detect remote DOCKER_HOST from current docker context #1025
When neither tc.host nor DOCKER_HOST is set, testcontainers-python falls
back to docker-py's default (local unix socket / named pipe). It does not
consult the current docker context.
This is surprising for users who use docker context use <name> to point at a
remote docker daemon (e.g. over SSH or a remote TCP endpoint). The docker
CLI works fine, but testcontainers tries to connect to the local socket and
fails — unless the user manually exports DOCKER_HOST.
docker context create remote --docker "host=ssh://user@remote-host"
docker context use remote
unset DOCKER_HOST
make tests # fails: cannot connect to /var/run/docker.sock
Proposal
Add a fallback in get_docker_host() that reads the current docker context's
host (via docker.context.ContextAPI) when no other source is configured,
while leaving the built-in default context to docker-py's normal handling.
Activity
feat(core): auto-detect DOCKER_HOST from current docker context (#1026)
chore(main): release testcontainers 4.15.0-rc3 (#1013)