Skip to content

Commit

Permalink
Allow default for --output flag.
Browse files Browse the repository at this point in the history
Signed-off-by: sudipto baral <[email protected]>
  • Loading branch information
sudiptob2 committed Jan 15, 2025
1 parent 5c5bc51 commit ac35c4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion commands/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,10 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions, debugConfig *debug.D
if v := os.Getenv("DOCKER_DEFAULT_PLATFORM"); v != "" {
platformsDefault = []string{v}
}
var outputDefault []string
if v := os.Getenv("DOCKER_DEFAULT_OUTPUT"); v != "" {
outputDefault = []string{v}
}

flags := cmd.Flags()

Expand Down Expand Up @@ -616,7 +620,7 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions, debugConfig *debug.D

flags.StringArrayVar(&options.noCacheFilter, "no-cache-filter", []string{}, "Do not cache specified stages")

flags.StringArrayVarP(&options.outputs, "output", "o", []string{}, `Output destination (format: "type=local,dest=path")`)
flags.StringArrayVarP(&options.outputs, "output", "o", outputDefault, `Output destination (format: "type=local,dest=path")`)

flags.StringArrayVar(&options.platforms, "platform", platformsDefault, "Set target platform for build")

Expand Down

0 comments on commit ac35c4e

Please sign in to comment.