0
0
mirror of https://github.com/thegeeklab/wp-docker-buildx.git synced 2024-11-24 23:00:39 +00:00
wp-docker-buildx/plugin/daemon.go

32 lines
527 B
Go
Raw Normal View History

package plugin
2019-08-14 19:51:43 +00:00
import (
"io"
2019-08-14 19:51:43 +00:00
"os"
"github.com/thegeeklab/wp-plugin-go/trace"
2019-08-14 19:51:43 +00:00
)
const (
dockerBin = "/usr/local/bin/docker"
dockerdBin = "/usr/local/bin/dockerd"
dockerHome = "/root/.docker/"
buildkitConfig = "/tmp/buildkit.toml"
)
2019-08-14 19:51:43 +00:00
func (p Plugin) startDaemon() {
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 = io.Discard
cmd.Stderr = io.Discard
2019-08-14 19:51:43 +00:00
}
2019-08-14 19:51:43 +00:00
go func() {
trace.Cmd(cmd)
_ = cmd.Run()
2019-08-14 19:51:43 +00:00
}()
2020-03-24 20:49:10 +00:00
}