Skip to content
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

Docs: Update documentation for TESTCONTAINERS_HOST_OVERRIDE #2555

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/system_requirements/ci/dind_patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Where:


!!! warning
If you are using Docker Desktop, you need to configure the `TESTCONTAINERS_HOST_OVERRIDE` environment variable to use the special DNS name
If you are using Docker Desktop, you need to configure the `TC_HOST` environment variable to use the special DNS name
`host.docker.internal` for accessing the host from within a container, which is provided by Docker Desktop:
`-e TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal`
`-e TC_HOST=host.docker.internal`

### Docker Compose example

Expand Down
4 changes: 2 additions & 2 deletions docs/system_requirements/ci/gitlab_ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ See below for an example runner configuration:
```

!!! warning
The environment variable `TESTCONTAINERS_HOST_OVERRIDE` needs to be configured, otherwise, a wrong IP address would be used to resolve the Docker host, which will likely lead to failing tests.
The environment variable `TC_HOST` needs to be configured, otherwise, a wrong IP address would be used to resolve the Docker host, which will likely lead to failing tests.

Please also include the following in your GitlabCI pipeline definitions (`.gitlab-ci.yml`) that use Testcontainers:

```yml
variables:
TESTCONTAINERS_HOST_OVERRIDE: "host.docker.internal"
TC_HOST: "host.docker.internal"
```
## Example using DinD (Docker-in-Docker)
Expand Down
2 changes: 1 addition & 1 deletion docs/system_requirements/rancher.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Steps are as follows:
```sh
export DOCKER_HOST=unix://$HOME/.rd/docker.sock
export TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
export TESTCONTAINERS_HOST_OVERRIDE=$(rdctl shell ip a show vznat | awk '/inet / {sub("/.*",""); print $2}')
export TC_HOST=$(rdctl shell ip a show vznat | awk '/inet / {sub("/.*",""); print $2}')
```

As always, remember that environment variables are not persisted unless you add them to the relevant file for your default shell e.g. `~/.zshrc`.
Expand Down