Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

fix finding dockerd so 17.06 works #1996

Merged
merged 1 commit into from Jul 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 18 additions & 6 deletions cmd/control/docker_init.go
Expand Up @@ -29,21 +29,33 @@ func dockerInitAction(c *cli.Context) error {
time.Sleep(200 * time.Millisecond)
}

dockerBin := "/usr/bin/docker"
for _, binPath := range []string{
dockerBin := ""
dockerPaths := []string{
"/usr/bin",
"/opt/bin",
"/usr/local/bin",
"/var/lib/rancher/docker",
} {
}
for _, binPath := range dockerPaths {
if util.ExistsAndExecutable(path.Join(binPath, "dockerd")) {
dockerBin = path.Join(binPath, "dockerd")
break
}
if util.ExistsAndExecutable(path.Join(binPath, "docker")) {
dockerBin = path.Join(binPath, "docker")
break
}
if dockerBin == "" {
for _, binPath := range dockerPaths {
if util.ExistsAndExecutable(path.Join(binPath, "docker")) {
dockerBin = path.Join(binPath, "docker")
break
}
}
}
if dockerBin == "" {
err := fmt.Errorf("Failed to find either dockerd or docker binaries")
log.Error(err)
return err
}
log.Infof("Found %s", dockerBin)

if err := syscall.Mount("", "/", "", syscall.MS_SHARED|syscall.MS_REC, ""); err != nil {
log.Error(err)
Expand Down