Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Use pg.get_container_host_ip and pg.get_connection_url #65

Merged
merged 8 commits into from
Dec 7, 2022

Conversation

razor-x
Copy link
Contributor

@razor-x razor-x commented Dec 1, 2022

  • get_container_host_ip() and get_connection_url() are provided by test containers as the way to get the correct URL to use, so they are preferred first.
  • TC_HOST is provided as an override for environments where testcontainers does not resolve the correct host address, in this case GitHub actions (removes hard-coded fallback that does not work on all platforms).
  • The Docker Desktop check is a workaround for this issue Docker in Docker on Mac requires to use host.docker.internal testcontainers/testcontainers-python#159 which affects any platform using docker desktop, not just darwin.

Note there is a completely separate issue (I will add to README in other PR) of finding the correct docker socket when using docker desktop. Docker patched this back for mac, but did not do the same for linux, so linux users must use a workaround like testcontainers/testcontainers-node#407 (comment) or testcontainers/testcontainers-node#407 (comment)

image

@razor-x razor-x marked this pull request as ready for review December 2, 2022 01:39
@razor-x razor-x merged commit 65aa17f into main Dec 7, 2022
@razor-x razor-x deleted the testcontainer-pg-params branch December 7, 2022 00:28
@seambot
Copy link
Contributor

seambot commented Feb 28, 2023

🎉 This issue has been resolved in version 2.7.0 🎉

The release is available on PyPI and GitHub.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants