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
I've been trying to incorporate a testcontainers test in our CI platform. To do this, I'm attempting to run testcontainers within a docker container by running docker-outside-of-docker (as described in the docs here).
I'm encountering an issue using the compose module, as ideally we'd like to reuse our existing docker compose file. It appears that testcontainers can't connect to the container brought up. I've noticed that it creates its own network, so I'm wondering if the container isn't part of the same network as the golang container where I'm running testcontainers from?
Another reason why I think this might be a networking inconsistency with the compose module is if I convert my use of the compose module into a ContainerRequest, the test can connect to the target container without errors.
Thanks in advance for your help, and happy to provide more info if required!
Relevant log output
=== RUN TestMain
**********************************************************************************************
Ryuk has been disabled forthe current execution. This can cause unexpected behaviorin your environment.
More on this: https://golang.testcontainers.org/features/garbage_collector/
**********************************************************************************************
2023/07/31 23:32:08 github.com/testcontainers/testcontainers-go - Connected to docker:
Server Version: 23.0.5
API Version: 1.42
Operating System: Docker Desktop
Total Memory: 7951 MB
Network end-to-end-test_default Creating
Network end-to-end-test_default Created
Container doomsday-notifications Creating
Container doomsday-notifications Created
Container doomsday-notifications Starting
Container doomsday-notifications Started
Container doomsday-notifications Waiting
Container doomsday-notifications Healthy
2023/07/31 23:32:09 github.com/testcontainers/testcontainers-go - Connected to docker:
Server Version: 23.0.5
API Version: 1.42
Operating System: Docker Desktop
Total Memory: 7951 MB
panic: test timed out after 30s
running tests:
TestMain (30s)
Additional information
No response
The text was updated successfully, but these errors were encountered:
Hey @n-tucker thanks for reporting this issue. I think this could be related to #1373 too. We added a docker host resolution algorithm and taking a deeper look, it's not taking into account the InAContainer function. Please look at this another issue that was solved for the k3s module: #1289
Testcontainers version
0.21.0
Using the latest Testcontainers version?
Yes
Host OS
Mac
Host arch
ARM
Go version
1.20.3
Docker version
Client: Cloud integration: v1.0.31 Version: 23.0.5 API version: 1.42 Go version: go1.19.8 Git commit: bc4487a Built: Wed Apr 26 16:12:52 2023 OS/Arch: darwin/arm64 Context: default Server: Docker Desktop 4.19.0 (106363) Engine: Version: 23.0.5 API version: 1.42 (minimum version 1.12) Go version: go1.19.8 Git commit: 94d3ad6 Built: Wed Apr 26 16:17:14 2023 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.20 GitCommit: 2806fc1057397dbaeefbea0e4e17bddfbd388f38 runc: Version: 1.1.5 GitCommit: v1.1.5-0-gf19387a docker-init: Version: 0.19.0 GitCommit: de40ad0
Docker info
What happened?
Hello,
I've been trying to incorporate a testcontainers test in our CI platform. To do this, I'm attempting to run testcontainers within a docker container by running docker-outside-of-docker (as described in the docs here).
I'm encountering an issue using the compose module, as ideally we'd like to reuse our existing docker compose file. It appears that testcontainers can't connect to the container brought up. I've noticed that it creates its own network, so I'm wondering if the container isn't part of the same network as the golang container where I'm running testcontainers from?
Another reason why I think this might be a networking inconsistency with the compose module is if I convert my use of the compose module into a
ContainerRequest
, the test can connect to the target container without errors.Thanks in advance for your help, and happy to provide more info if required!
Relevant log output
Additional information
No response
The text was updated successfully, but these errors were encountered: