2021-01-11 20:54:49 +00:00
|
|
|
package plugin
|
2019-08-14 19:51:43 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
|
|
|
const dockerExe = "/usr/local/bin/docker"
|
|
|
|
const dockerdExe = "/usr/local/bin/dockerd"
|
2020-03-24 20:49:10 +00:00
|
|
|
const dockerHome = "/root/.docker/"
|
2019-08-14 19:51:43 +00:00
|
|
|
|
|
|
|
func (p Plugin) startDaemon() {
|
2021-01-11 20:54:49 +00:00
|
|
|
cmd := commandDaemon(p.settings.Daemon)
|
|
|
|
if p.settings.Daemon.Debug {
|
2019-08-14 19:51:43 +00:00
|
|
|
cmd.Stdout = os.Stdout
|
|
|
|
cmd.Stderr = os.Stderr
|
|
|
|
} else {
|
|
|
|
cmd.Stdout = ioutil.Discard
|
|
|
|
cmd.Stderr = ioutil.Discard
|
|
|
|
}
|
|
|
|
go func() {
|
|
|
|
trace(cmd)
|
|
|
|
cmd.Run()
|
|
|
|
}()
|
2020-03-24 20:49:10 +00:00
|
|
|
}
|