Skip to content

Commit

Permalink
Merge branch 'main' into v1
Browse files Browse the repository at this point in the history
* main:
  fix: Rename TC_HOST environment variable to TESTCONTAINERS_HOST_OVERRIDE (#2536)
  • Loading branch information
mdelapenya committed Jun 28, 2024
2 parents cdaec16 + 4ce4d87 commit 2599be8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion daemonhost.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion docs/features/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ It is normally advisable to use `Host` and `MappedPort` together when constructi
<!--/codeinclude-->

!!! 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

Expand Down
2 changes: 1 addition & 1 deletion docs/system_requirements/using_podman.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2599be8

Please sign in to comment.