Hello, I’m using Docker Swarm and I want to update a container from inside it and I’m using the following command:
cmd := "docker"
args := []string{“update”, “-m”, strconv.FormatFloat(newMemory, ‘f’, -1 ,64), “-c”, strconv.FormatFloat(newCPU, ‘f’, -1, 64), containerID}
if err := exec.Command(cmd, args…).Run(); err != nil {
fmt.Println(“Error using docker update”)
fmt.Println(err)
}
This does not work and err prints the following:
exec: “docker”: executable file not found in $PATH
I use the same code outside Swarm and it works fine but inside Swarm provides that error.
Thanks for your time
Sérgio Mendes