-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add docs for using Gitlab CI with Docker wormhole executor #4770
Conversation
I had problems to get my configuration working for testcontainers in combination with gitlab. On my machine everything did run completely fine. But in Gitlab CI I got problems with Ryuk and also my mongo container couldn't be found. This was due to a wrong resolved ip address. I found out when setting the `TESTCONTAINERS_HOST_OVERRIDE` to `host.docker.internal` that it helped me a lot to solve these issues (since testcontainers exposes the ports on the host). Since my configuration is quite generic, I thought it would be nice to include it in the docs so other people could also benefit.
Hi @JurrianFahner, Therefore, I think it is best to only document the need for
in case of using a Docker-Socket-Mounting setup. Besides this, I wonder if something has changed on the GitLab-CI side since I used to run exactly this setup some years ago without the need of setting |
@kiview It worked for me till I upgraded from 1.15.1 to 1.16.2. The problem is that testcontainers somehow got the ip address wrong. You have definitely a point by make the contribution smaller and describe it as a known issue, which might be fixed by only describe how it can be fixed with I'll rewrite my contribution somewhere this week. Thanks for your fast response! |
Thanks for the clarification. Do you have a way to quickly check if the current DinD based GitLab-CI docs are also broken after |
No, I don't have a way to check quickly DinD configuration. I suspect that DinD is also broken. I also don't think the docker socket is the problem, whether you would use a tcp socket or a file socket that doesn't matter (from my point of view). In my case the docker container is created (via the /var/run/docker.sock), but the testcontainer library can't find my host ip. So the created docker container can't be reached by the test. |
@kiview I have looked in the gitlab docs for a good example of a gitlab runner. But I couldn't find it. Can we leave it here? I have removed the parts that are empty. Another approach would be to add examples on gitlab to demonstrate how to perform testcontainer tests on gitlab within a docker container. I have already created a gitlab group for it: https://gitlab.com/testcontainers-examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested some changes to the wording. Afterwards, it is good to go from my side, thanks 👍
Regarding your proposal about example GitLab projects, this sounds like a very good idea. What I would imagine (at least for now) is a community maintained project, that shows how the different executors have to be configured to work with Testcontainers. Ideally this would also help us in catching regressions with regards to GitLab CI.
docs/supported_docker_environment/continuous_integration/gitlab_ci.md
Outdated
Show resolved
Hide resolved
docs/supported_docker_environment/continuous_integration/gitlab_ci.md
Outdated
Show resolved
Hide resolved
docs/supported_docker_environment/continuous_integration/gitlab_ci.md
Outdated
Show resolved
Hide resolved
docs/supported_docker_environment/continuous_integration/gitlab_ci.md
Outdated
Show resolved
Hide resolved
docs/supported_docker_environment/continuous_integration/gitlab_ci.md
Outdated
Show resolved
Hide resolved
docs/supported_docker_environment/continuous_integration/gitlab_ci.md
Outdated
Show resolved
Hide resolved
@kiview I'm convinced that I did apply your feedback. Can you approve? |
@kiview Can you give it a second look? Your suggestions have been applied. But somehow github doesn't pick it up.... |
@JurrianFahner Sorry for having this overlooked, I just merged it. Thanks a lot for this contribution 🙌 |
I had problems to get my configuration working for testcontainers in combination with gitlab. On my machine everything did run completely fine. But in Gitlab CI I got problems with Ryuk and also my mongo container couldn't be found. This was due to a wrong resolved ip address.
I found out when setting the
TESTCONTAINERS_HOST_OVERRIDE
tohost.docker.internal
that it helped me a lot to solve these issues (since testcontainers exposes the ports on the host).Since my configuration is quite generic, I thought it would be nice to include it in the docs so other people could also benefit.