提交 1663a030 编写于 作者: A Anders F Björklund

Only add docker group for the docker runtime

上级 b2121eae
......@@ -20,6 +20,7 @@ import (
"fmt"
"net"
"os"
"os/exec"
"path"
"strconv"
"time"
......@@ -124,6 +125,12 @@ func (d *Driver) Create() error {
}
}
if d.runtime.Name() == "Docker" {
if _, err := d.exec.RunCmd(exec.Command("sudo", "usermod", "-aG", "docker", d.GetSSHUsername())); err != nil {
return errors.Wrap(err, "usermod")
}
}
log.Debugf("IP: %s", d.IPAddress)
return nil
......
......@@ -174,12 +174,6 @@ func createHost(api libmachine.API, cfg *config.ClusterConfig, n *config.Node) (
return h, errors.Wrap(err, "post-start")
}
if driver.IsSSH(h.Driver.DriverName()) {
if _, err := h.RunSSHCommand(fmt.Sprintf("sudo usermod -aG docker %s", h.Driver.GetSSHUsername())); err != nil {
return h, errors.Wrap(err, "usermod")
}
}
if err := saveHost(api, h, cfg, n); err != nil {
return h, err
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册