1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/integration-cli/docker_test_vars.go
Alexandr Morozov 652cd6a842 Test on execdriver dir behavior
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-09-22 22:49:21 +04:00

42 lines
1,003 B
Go

package main
import (
"fmt"
"os"
"os/exec"
)
// the docker binary to use
var dockerBinary = "docker"
// the private registry image to use for tests involving the registry
var registryImageName = "registry"
// the private registry to use for tests
var privateRegistryURL = "127.0.0.1:5000"
var execDriverPath = "/var/lib/docker/execdriver/native"
var workingDirectory string
func init() {
if dockerBin := os.Getenv("DOCKER_BINARY"); dockerBin != "" {
dockerBinary = dockerBin
} else {
whichCmd := exec.Command("which", "docker")
out, _, err := runCommandWithOutput(whichCmd)
if err == nil {
dockerBinary = stripTrailingCharacters(out)
} else {
fmt.Printf("ERROR: couldn't resolve full path to the Docker binary")
os.Exit(1)
}
}
if registryImage := os.Getenv("REGISTRY_IMAGE"); registryImage != "" {
registryImageName = registryImage
}
if registry := os.Getenv("REGISTRY_URL"); registry != "" {
privateRegistryURL = registry
}
workingDirectory, _ = os.Getwd()
}