Skip to content

Commit

Permalink
cmd/buildx: add empty by default experimental variable
Browse files Browse the repository at this point in the history
To guard this Docker CLI plugin with docker's experimental CLI config,
buildx needs to be built with `go build -ldflags "-X main.experimental=1"`

Signed-off-by: Tibor Vass <tibor@docker.com>
  • Loading branch information
Tibor Vass committed May 23, 2019
1 parent 03ae6f8 commit dcc0e3f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/buildx/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
_ "github.com/docker/buildx/driver/docker-container"
)

var experimental string

func main() {
if os.Getenv("DOCKER_CLI_PLUGIN_ORIGINAL_CLI_COMMAND") == "" {
if len(os.Args) < 2 || os.Args[1] != manager.MetadataSubcommandName {
Expand All @@ -41,5 +43,6 @@ func main() {
SchemaVersion: "0.1.0",
Vendor: "Docker Inc.",
Version: version.Version,
Experimental: experimental != "",
})
}

0 comments on commit dcc0e3f

Please sign in to comment.