buildkit/frontend/dockerfile/cmd/dockerfile-frontend/main.go

34 lines
702 B
Go
Raw Normal View History

package main
import (
"flag"
"fmt"
"os"
dockerfile "github.com/moby/buildkit/frontend/dockerfile/builder"
"github.com/moby/buildkit/frontend/gateway/grpcclient"
"github.com/moby/buildkit/util/appcontext"
"github.com/moby/buildkit/util/stack"
"github.com/sirupsen/logrus"
)
func init() {
stack.SetVersionInfo(Version, Revision)
}
func main() {
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)
}
if err := grpcclient.RunFromEnvironment(appcontext.Context(), dockerfile.Build); err != nil {
logrus.Errorf("fatal error: %+v", err)
panic(err)
}
}