Add LXD support

This commit is contained in:
jiazio
2017-01-06 22:11:13 +09:00
parent cb29289167
commit 6ecd70220b
5 changed files with 91 additions and 0 deletions

View File

@@ -307,6 +307,8 @@ func decolateCmd(c conf.ServerInfo, cmd string, sudo bool) string {
switch c.Container.Type {
case "", "docker":
cmd = fmt.Sprintf(`docker exec %s /bin/bash -c "%s"`, c.Container.ContainerID, cmd)
case "lxd":
cmd = fmt.Sprintf(`lxc exec %s -- /bin/bash -c "%s"`, c.Container.Name, cmd)
}
}
// cmd = fmt.Sprintf("set -x; %s", cmd)