github.com/slava-ustovytski/docker@v1.8.2-rc1/integration-cli/docker_test_vars.go (about) 1 package main 2 3 import ( 4 "fmt" 5 "os" 6 "os/exec" 7 ) 8 9 var ( 10 // the docker binary to use 11 dockerBinary = "docker" 12 13 // the private registry image to use for tests involving the registry 14 registryImageName = "registry" 15 16 // the private registry to use for tests 17 privateRegistryURL = "127.0.0.1:5000" 18 19 dockerBasePath = "/var/lib/docker" 20 volumesConfigPath = dockerBasePath + "/volumes" 21 containerStoragePath = dockerBasePath + "/containers" 22 23 runtimePath = "/var/run/docker" 24 execDriverPath = runtimePath + "/execdriver/native" 25 26 workingDirectory string 27 ) 28 29 func init() { 30 if dockerBin := os.Getenv("DOCKER_BINARY"); dockerBin != "" { 31 dockerBinary = dockerBin 32 } 33 var err error 34 dockerBinary, err = exec.LookPath(dockerBinary) 35 if err != nil { 36 fmt.Printf("ERROR: couldn't resolve full path to the Docker binary (%v)", err) 37 os.Exit(1) 38 } 39 if registryImage := os.Getenv("REGISTRY_IMAGE"); registryImage != "" { 40 registryImageName = registryImage 41 } 42 if registry := os.Getenv("REGISTRY_URL"); registry != "" { 43 privateRegistryURL = registry 44 } 45 workingDirectory, _ = os.Getwd() 46 }