refactor: update dependencies and use plugin boilerplate

This commit is contained in:
Robert Kaussow
2021-01-11 21:54:49 +01:00
parent 441d5a1f52
commit ba28c39a7d
13 changed files with 788 additions and 692 deletions

25
plugin/daemon.go Normal file
View File

@@ -0,0 +1,25 @@
package plugin
import (
"io/ioutil"
"os"
)
const dockerExe = "/usr/local/bin/docker"
const dockerdExe = "/usr/local/bin/dockerd"
const dockerHome = "/root/.docker/"
func (p Plugin) startDaemon() {
cmd := commandDaemon(p.settings.Daemon)
if p.settings.Daemon.Debug {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
} else {
cmd.Stdout = ioutil.Discard
cmd.Stderr = ioutil.Discard
}
go func() {
trace(cmd)
cmd.Run()
}()
}