Skip to content

Commit

Permalink
PRODENG-2744 Use explicit binary path for docker (#517)
Browse files Browse the repository at this point in the history
Co-authored-by: Pathma Sri Ambegode Gedara <[email protected]>
  • Loading branch information
james-nesbitt and pgedara authored Nov 5, 2024
1 parent 7f96730 commit 4a02a4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/configurer/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/product/mke/api/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4a02a4a

Please sign in to comment.