From 0d6275b298ebb9161c2f55d4b4ac0f87603a11cd Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Wed, 5 Mar 2014 01:54:08 +0000 Subject: [PATCH] if client has no git, use server Docker-DCO-1.1-Signed-off-by: Victor Vieux (github: vieux) --- api/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/client.go b/api/client.go index 6dabeac835..4854c19013 100644 --- a/api/client.go +++ b/api/client.go @@ -161,6 +161,8 @@ func (cli *DockerCli) CmdBuild(args ...string) error { err error ) + _, err = exec.LookPath("git") + hasGit := err == nil if cmd.Arg(0) == "-" { // As a special case, 'docker build -' will build from an empty context with the // contents of stdin as a Dockerfile @@ -169,7 +171,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error { return err } context, err = archive.Generate("Dockerfile", string(dockerfile)) - } else if utils.IsURL(cmd.Arg(0)) && !utils.IsGIT(cmd.Arg(0)) { + } else if utils.IsURL(cmd.Arg(0)) && (!utils.IsGIT(cmd.Arg(0)) || !hasGit) { isRemote = true } else { root := cmd.Arg(0)