Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: default for docker host
Browse files Browse the repository at this point in the history
mdelapenya committed Mar 15, 2023

Verified

This commit was signed with the committer’s verified signature.
fiji-flo Florian Dieminger
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
@@ -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) {

0 comments on commit 560672a

Please sign in to comment.