2021-01-11 20:54:49 +00:00
|
|
|
package plugin
|
2019-08-14 19:51:43 +00:00
|
|
|
|
|
|
|
import (
|
2021-07-25 12:28:33 +00:00
|
|
|
"io"
|
2019-08-14 19:51:43 +00:00
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
2022-09-27 20:33:05 +00:00
|
|
|
const (
|
|
|
|
dockerExe = "/usr/local/bin/docker"
|
|
|
|
dockerdExe = "/usr/local/bin/dockerd"
|
|
|
|
dockerHome = "/root/.docker/"
|
|
|
|
buildkitConfig = "/tmp/buildkit.toml"
|
|
|
|
buildkitConfigTemplate = "[registry.\"%s\"]\n ca=[\"%s\"]\n"
|
|
|
|
)
|
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 {
|
2021-07-25 12:28:33 +00:00
|
|
|
cmd.Stdout = io.Discard
|
|
|
|
cmd.Stderr = io.Discard
|
2019-08-14 19:51:43 +00:00
|
|
|
}
|
|
|
|
go func() {
|
|
|
|
trace(cmd)
|
|
|
|
cmd.Run()
|
|
|
|
}()
|
2020-03-24 20:49:10 +00:00
|
|
|
}
|