Skip to content

WIP: Host ip fix #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

gel-bcegielka
Copy link

No description provided.

@gel-bcegielka gel-bcegielka changed the title Host ip fix WIP: Host ip fix Sep 8, 2021
@gel-bcegielka
Copy link
Author

gel-bcegielka commented Sep 8, 2021

Apologies, I was meant to create PR in my fork, but didn't change the base. This can be closed as it was a dirty hack to get testcontainers in gitlab dind setup.
It such case
https://github.com/testcontainers/testcontainers-python/blob/master/testcontainers/core/container.py#L79
function get_container_host_ip returns container’s bridge ip 178.18.0.1
Connection url: postgresql+psycopg2://test:[email protected]:32768/test
which does not work.

What we need it docker service ip we started with .gitlab-ci.yml:

  services:
    - docker:19.03.13-dind
  variables:
    DOCKER_HOST: tcp://docker:2376
    DOCKER_TLS_CERTDIR: "/certs"
    DOCKER_TLS_VERIFY: 1
    DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"

which is

$ ping -c 1 docker
PING docker (172.17.0.2): 56 data bytes

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

Successfully merging this pull request may close these issues.

2 participants