build: add --platform local

Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit daca70d820)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Tibor Vass 2019-05-07 22:25:40 +00:00 committed by Sebastiaan van Stijn
parent 529b1e7ec7
commit 8758cdca10
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import (
"strings" "strings"
"github.com/containerd/console" "github.com/containerd/console"
"github.com/containerd/containerd/platforms"
"github.com/docker/cli/cli" "github.com/docker/cli/cli"
"github.com/docker/cli/cli/command" "github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/command/image/build" "github.com/docker/cli/cli/command/image/build"
@ -219,6 +220,10 @@ func runBuildBuildKit(dockerCli command.Cli, options buildOptions) error {
options.progress = v options.progress = v
} }
if strings.EqualFold(options.platform, "local") {
options.platform = platforms.DefaultString()
}
eg.Go(func() error { eg.Go(func() error {
defer func() { // make sure the Status ends cleanly on build errors defer func() { // make sure the Status ends cleanly on build errors
s.Close() s.Close()