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-04-25 10:51:42 +00:00
|
|
|
const (
|
|
|
|
dockerExe = "/usr/local/bin/docker"
|
|
|
|
dockerdExe = "/usr/local/bin/dockerd"
|
|
|
|
dockerHome = "/root/.docker/"
|
2023-01-08 13:41:49 +00:00
|
|
|
buildkitConfig = "/tmp/buildkit.toml"
|
2022-04-25 10:51:42 +00:00
|
|
|
)
|
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)
|
2022-04-25 10:51:42 +00:00
|
|
|
_ = cmd.Run()
|
2019-08-14 19:51:43 +00:00
|
|
|
}()
|
2020-03-24 20:49:10 +00:00
|
|
|
}
|