Skip to content

Commit

Permalink
Merge pull request #6 from depot/default-load
Browse files Browse the repository at this point in the history
Default `depot build` to `--load`
  • Loading branch information
kodiakhq[bot] authored Mar 19, 2022
2 parents 306a3f9 + 2d104ff commit 44a64f3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/cmd/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ func NewCmdBuild() *cobra.Command {
os.Exit(1)
}

// If neither --load or --push is specified, we default to --load
if !options.exportLoad && !options.exportPush && len(options.outputs) == 0 {
options.exportLoad = true
}

options.contextPath = args[0]
return runBuild(dockerCli, options)
},
Expand Down Expand Up @@ -77,7 +82,7 @@ func NewCmdBuild() *cobra.Command {
flags.StringVarP(&options.dockerfileName, "file", "f", "", `Name of the Dockerfile (default: "PATH/Dockerfile")`)
flags.StringVar(&options.imageIDFile, "iidfile", "", "Write the image ID to the file")
flags.StringArrayVar(&options.labels, "label", []string{}, "Set metadata for an image")
flags.BoolVar(&options.exportLoad, "load", false, `Shorthand for "--output=type=docker"`)
flags.BoolVar(&options.exportLoad, "load", false, `Shorthand for "--output=type=docker" (default unless --push or --output is specified)`)
flags.StringVar(&options.networkMode, "network", "default", `Set the networking mode for the "RUN" instructions during build`)
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")`)
Expand Down

0 comments on commit 44a64f3

Please sign in to comment.