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
Bug: tc.host support issue - failing to connect to dockerd if tc.host is present #494
when we added #388 it reads stale data (or even in an older format?) and fails to connect to docker, preferring to connect to a tc desktop that may not be running anymore.
this library should validate the format before consuming the value, and potentially also check for a healthy server running on that port.
To Reproduce
Add/comment/uncomment the below line in ~/.testcontainers.properties
#524 related kind of, was thinking of consolidating PRs:
defget_docker_host() ->Optional[str]:
tc_host=read_tc_properties().get("tc.host")
# make sure if we have a value, that it is still valid (we can talk to it via tcp)iftc_host:
try:
withsocket(AF_INET, SOCK_STREAM) assock:
sock.settimeout(1)
sock.connect(*(urllib.parse.urlparse(tc_host).netloc.rsplit(":", 1)))
exceptConnectionRefusedError:
tc_host=Nonereturntc_hostoros.getenv("DOCKER_HOST")
Activity
[-]Bug: [/-][+]Bug: tc.host support issue - failing to connect to dockerd if tc.host is present[/+]alexanderankin commentedon Apr 2, 2024
#524 related kind of, was thinking of consolidating PRs:
encapsulate get_tc_host for #494