From 03dc06f89d5a615cc3110371a5b19ddfa61442e8 Mon Sep 17 00:00:00 2001 From: Pathma Sri Ambegode Gedara Date: Thu, 31 Oct 2024 01:42:23 -0400 Subject: [PATCH] PRODENG-2744 Use explicit binary path for docker --- pkg/configurer/linux.go | 2 +- pkg/product/mke/api/host.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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