diff --git a/pkg/configurer/linux.go b/pkg/configurer/linux.go index 67815cd4..3a0ece3f 100644 --- a/pkg/configurer/linux.go +++ b/pkg/configurer/linux.go @@ -112,7 +112,7 @@ func (c LinuxConfigurer) ResolveInternalIP(h os.Host, privateInterface, publicIP // DockerCommandf accepts a printf-like template string and arguments // and builds a command string for running the docker cli on the host. func (c LinuxConfigurer) DockerCommandf(template string, args ...interface{}) string { - return fmt.Sprintf("docker %s", fmt.Sprintf(template, args...)) + return fmt.Sprintf("/usr/bin/docker %s", fmt.Sprintf(template, args...)) } // ValidateLocalhost returns an error if "localhost" is not a local address. diff --git a/pkg/product/mke/api/host.go b/pkg/product/mke/api/host.go index 195700bd..d6cf7107 100644 --- a/pkg/product/mke/api/host.go +++ b/pkg/product/mke/api/host.go @@ -111,7 +111,7 @@ func (h *Host) IsLocal() bool { // IsSudoCommand is a particluar string command supposed to use Sudo. func (h *Host) IsSudoCommand(cmd string) bool { - if h.SudoDocker && strings.HasPrefix(cmd, "docker") { + if h.SudoDocker && (strings.HasPrefix(cmd, "docker") || strings.HasPrefix(cmd, "/usr/bin/docker")) { return true } return false