Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cli/command/image/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type buildOptions struct {
target string
imageIDFile string
stream bool
platform string
}

// dockerfileFromStdin returns true when the user specified that the Dockerfile
Expand Down Expand Up @@ -143,6 +144,8 @@ func NewBuildCommand(dockerCli command.Cli) *cobra.Command {
flags.SetAnnotation("stream", "experimental", nil)
flags.SetAnnotation("stream", "version", []string{"1.31"})

flags.StringVar(&options.platform, "platform", "", "Set platform if server is multi-platform capable")
flags.SetAnnotation("platform", "version", []string{"1.30"})
return cmd
}

Expand Down Expand Up @@ -372,6 +375,7 @@ func runBuild(dockerCli command.Cli, options buildOptions) error {
ExtraHosts: options.extraHosts.GetAll(),
Target: options.target,
RemoteContext: remote,
Platform: options.platform,
}

if s != nil {
Expand Down
2 changes: 1 addition & 1 deletion vendor/github.com/docker/docker/api/common.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions vendor/github.com/docker/docker/api/types/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions vendor/github.com/docker/docker/client/image_build.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.