Skip to content

Commit

Permalink
fix: default for docker host
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Mar 15, 2023
1 parent 9532872 commit 560672a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ More on this: https://golang.testcontainers.org/features/garbage_collector/
// readConfig reads from testcontainers properties file, if it exists
// it is possible that certain values get overridden when set as environment variables
func readConfig() TestcontainersConfig {
config := TestcontainersConfig{
Host: "unix:///var/run/docker.sock",
}
config := TestcontainersConfig{}

applyEnvironmentConfiguration := func(config TestcontainersConfig) TestcontainersConfig {
if dockerHostEnv := os.Getenv("DOCKER_HOST"); dockerHostEnv != "" {
config.Host = dockerHostEnv
}
if config.Host == "" {
config.Host = "unix:///var/run/docker.sock"
}

ryukDisabledEnv := os.Getenv("TESTCONTAINERS_RYUK_DISABLED")
if parseBool(ryukDisabledEnv) {
Expand Down

0 comments on commit 560672a

Please sign in to comment.