mirror of
https://github.com/docker/cli.git
synced 2026-09-25 17:02:07 -04:00
Allow specifying the docker client path in _DOCKER_INIT_PATH
I currently need this to get the tests running, otherwise it will mount the docker.test binary inside the containers, which doesn't work due to the libdevmapper.so dependency. Upstream-commit: 6938a36c6985336205f1db247baec5e56fdac466 Component: engine
This commit is contained in:
committed by
Victor Vieux
parent
5e59cd4e23
commit
a7892eb98a
@@ -52,16 +52,21 @@ type Runtime struct {
|
||||
var sysInitPath string
|
||||
|
||||
func init() {
|
||||
selfPath := utils.SelfPath()
|
||||
|
||||
// If we have a separate docker-init, use that, otherwise use the
|
||||
// main docker binary
|
||||
dir := filepath.Dir(selfPath)
|
||||
dockerInitPath := filepath.Join(dir, "docker-init")
|
||||
if _, err := os.Stat(dockerInitPath); err != nil {
|
||||
sysInitPath = selfPath
|
||||
env := os.Getenv("_DOCKER_INIT_PATH")
|
||||
if env != "" {
|
||||
sysInitPath = env
|
||||
} else {
|
||||
sysInitPath = dockerInitPath
|
||||
selfPath := utils.SelfPath()
|
||||
|
||||
// If we have a separate docker-init, use that, otherwise use the
|
||||
// main docker binary
|
||||
dir := filepath.Dir(selfPath)
|
||||
dockerInitPath := filepath.Join(dir, "docker-init")
|
||||
if _, err := os.Stat(dockerInitPath); err != nil {
|
||||
sysInitPath = selfPath
|
||||
} else {
|
||||
sysInitPath = dockerInitPath
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user