2017-10-03 21:31:46 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2018-10-16 18:37:41 +00:00
|
|
|
"flag"
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
2018-07-05 23:32:01 +00:00
|
|
|
dockerfile "github.com/moby/buildkit/frontend/dockerfile/builder"
|
2017-12-13 23:46:52 +00:00
|
|
|
"github.com/moby/buildkit/frontend/gateway/grpcclient"
|
2017-10-03 21:31:46 +00:00
|
|
|
"github.com/moby/buildkit/util/appcontext"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2018-10-16 18:37:41 +00:00
|
|
|
var version bool
|
|
|
|
flag.BoolVar(&version, "version", false, "show version")
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
if version {
|
|
|
|
fmt.Printf("%s %s %s %s\n", os.Args[0], Package, Version, Revision)
|
|
|
|
os.Exit(0)
|
|
|
|
}
|
|
|
|
|
2018-07-25 09:55:44 +00:00
|
|
|
if err := grpcclient.RunFromEnvironment(appcontext.Context(), dockerfile.Build); err != nil {
|
2017-10-03 21:31:46 +00:00
|
|
|
logrus.Errorf("fatal error: %+v", err)
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|