Skip to content

Commit

Permalink
update TESTCONTAINERS_HOST_OVERRIDE documentation to TC_HOST
Browse files Browse the repository at this point in the history
  • Loading branch information
david-kalmakoff committed May 28, 2024
1 parent d4a21ea commit 5cf162b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
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

0 comments on commit 5cf162b

Please sign in to comment.