builder: set buildkit's exported product variable via PRODUCT
This introduces a PRODUCT environment variable that is used to set a constant at dockerversion.ProductName. That is then used to set BuildKit's ExportedProduct variable in order to show useful error messages to users when a certain version of the product doesn't support a BuildKit feature. Signed-off-by: Tibor Vass <tibor@docker.com> Upstream-commit: 195919d9d645aa4ab5680a2331c57ff33eb9e5d9 Component: engine
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/docker/docker/dockerversion"
|
||||
"github.com/docker/docker/pkg/reexec"
|
||||
"github.com/docker/docker/pkg/term"
|
||||
"github.com/moby/buildkit/util/apicaps"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -42,6 +43,12 @@ func newDaemonCommand() *cobra.Command {
|
||||
return cmd
|
||||
}
|
||||
|
||||
func init() {
|
||||
if dockerversion.ProductName != "" {
|
||||
apicaps.ExportedProduct = dockerversion.ProductName
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
if reexec.Init() {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user