From 3c2cab11aae7e98c809f9154deddd1f86fdadf83 Mon Sep 17 00:00:00 2001 From: David Calavera Date: Fri, 17 Apr 2015 15:30:22 -0700 Subject: [PATCH] Shallow clone using git to build images. Signed-off-by: David Calavera Upstream-commit: 36fbf4b86469ca6fe3677d47c9a1976bcdd111e4 Component: engine --- components/engine/builder/job.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/engine/builder/job.go b/components/engine/builder/job.go index 115d89a4b9..7ea1ae30b9 100644 --- a/components/engine/builder/job.go +++ b/components/engine/builder/job.go @@ -114,7 +114,7 @@ func Build(d *daemon.Daemon, buildConfig *Config) error { } defer os.RemoveAll(root) - if output, err := exec.Command("git", "clone", "--recursive", buildConfig.RemoteURL, root).CombinedOutput(); err != nil { + if output, err := exec.Command("git", "clone", "--depth", "1", "--recursive", buildConfig.RemoteURL, root).CombinedOutput(); err != nil { return fmt.Errorf("Error trying to use git: %s (%s)", err, output) }