diff --git a/daemonhost.go b/daemonhost.go index 23e20cb90b..b78c7a05b4 100644 --- a/daemonhost.go +++ b/daemonhost.go @@ -16,7 +16,7 @@ import ( func DaemonHost(ctx context.Context) (string, error) { var hostCache string - host, exists := os.LookupEnv("TC_HOST") + host, exists := os.LookupEnv("TESTCONTAINERS_HOST_OVERRIDE") if exists { hostCache = host return hostCache, nil diff --git a/docker.go b/docker.go index cf1ba45d0c..cc0edc9ace 100644 --- a/docker.go +++ b/docker.go @@ -349,7 +349,7 @@ func (c *DockerContainer) GetImage() string { // Host gets host (ip or name) of the docker daemon where the container port is exposed // Warning: this is based on your Docker host setting. Will fail if using an SSH tunnel -// You can use the "TC_HOST" env variable to set this yourself +// You can use the "TESTCONTAINERS_HOST_OVERRIDE" env variable to set this yourself func (c *DockerContainer) Host(ctx context.Context) (string, error) { host, err := DaemonHost(ctx) if err != nil { diff --git a/docs/features/networking.md b/docs/features/networking.md index 64c7e9a1bb..2becaed972 100644 --- a/docs/features/networking.md +++ b/docs/features/networking.md @@ -45,7 +45,7 @@ It is normally advisable to use `Host` and `MappedPort` together when constructi !!! info - Setting the `TC_HOST` environment variable overrides the host of the docker daemon where the container port is exposed. For example, `TC_HOST=172.17.0.1`. + Setting the `TESTCONTAINERS_HOST_OVERRIDE` environment variable overrides the host of the docker daemon where the container port is exposed. For example, `TESTCONTAINERS_HOST_OVERRIDE=172.17.0.1`. ## Exposing host ports to the container diff --git a/docs/system_requirements/using_podman.md b/docs/system_requirements/using_podman.md index 72340f7edf..2e651c0f03 100644 --- a/docs/system_requirements/using_podman.md +++ b/docs/system_requirements/using_podman.md @@ -3,7 +3,7 @@ _Testcontainers for Go_ supports the use of Podman (rootless or rootful) instead of Docker. In most scenarios no special setup is required in _Testcontainers for Go_. -_Testcontainers for Go_ will automatically discover the socket based on the `DOCKER_HOST` or the `TC_HOST` environment variables. +_Testcontainers for Go_ will automatically discover the socket based on the `DOCKER_HOST` environment variables. Alternatively you can configure the host with a `.testcontainers.properties` file. The discovered Docker host is taken into account when starting a reaper container. The discovered socket is used to detect the use of Podman.