Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request moby#26839 from tonistiigi/build-cache
Browse files Browse the repository at this point in the history
Implement build cache based on history array
Arnaud Porterie authored Sep 26, 2016
2 parents 56d92bf + fe4cc3f commit dc14c5a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions command/image/build.go
Original file line number Diff line number Diff line change
@@ -55,6 +55,7 @@ type buildOptions struct {
rm bool
forceRm bool
pull bool
cacheFrom []string
}

// NewBuildCommand creates a new `docker build` command
@@ -98,6 +99,7 @@ func NewBuildCommand(dockerCli *command.DockerCli) *cobra.Command {
flags.BoolVar(&options.forceRm, "force-rm", false, "Always remove intermediate containers")
flags.BoolVarP(&options.quiet, "quiet", "q", false, "Suppress the build output and print image ID on success")
flags.BoolVar(&options.pull, "pull", false, "Always attempt to pull a newer version of the image")
flags.StringSliceVar(&options.cacheFrom, "cache-from", []string{}, "Images to consider as cache sources")

command.AddTrustedFlags(flags, true)

@@ -289,6 +291,7 @@ func runBuild(dockerCli *command.DockerCli, options buildOptions) error {
BuildArgs: runconfigopts.ConvertKVStringsToMap(options.buildArgs.GetAll()),
AuthConfigs: authConfig,
Labels: runconfigopts.ConvertKVStringsToMap(options.labels),
CacheFrom: options.cacheFrom,
}

response, err := dockerCli.Client().ImageBuild(ctx, body, buildOptions)

0 comments on commit dc14c5a

Please sign in to comment.