Merge pull request #70 from tonistiigi/no-progress

buildctl: non-interactive output support
docker-18.09
Akihiro Suda 2017-07-13 13:17:40 +09:00 committed by GitHub
commit 405cc8d79f
1 changed files with 18 additions and 0 deletions

View File

@ -29,6 +29,10 @@ var buildCommand = cli.Command{
Name: "exporter-opt", Name: "exporter-opt",
Usage: "Define custom options for exporter", Usage: "Define custom options for exporter",
}, },
cli.BoolFlag{
Name: "no-progress",
Usage: "Don't show interactive progress",
},
}, },
} }
@ -72,6 +76,20 @@ func build(clicontext *cli.Context) error {
}) })
eg.Go(func() error { eg.Go(func() error {
if clicontext.Bool("no-progress") {
for s := range displayCh {
for _, v := range s.Vertexes {
logrus.Debugf("vertex: %s %s %v %v", v.Digest, v.Name, v.Started, v.Completed)
}
for _, s := range s.Statuses {
logrus.Debugf("status: %s %s", s.Vertex, s.ID)
}
for _, l := range s.Logs {
logrus.Debugf("log: %s\n%s", l.Vertex, l.Data)
}
}
return nil
}
// not using shared context to not disrupt display but let is finish reporting errors // not using shared context to not disrupt display but let is finish reporting errors
return progressui.DisplaySolveStatus(context.TODO(), displayCh) return progressui.DisplaySolveStatus(context.TODO(), displayCh)
}) })