mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
if client has no git, use server
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
This commit is contained in:
parent
8301fc8e56
commit
0d6275b298
1 changed files with 3 additions and 1 deletions
|
@ -161,6 +161,8 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
|
||||||
|
_, err = exec.LookPath("git")
|
||||||
|
hasGit := err == nil
|
||||||
if cmd.Arg(0) == "-" {
|
if cmd.Arg(0) == "-" {
|
||||||
// As a special case, 'docker build -' will build from an empty context with the
|
// As a special case, 'docker build -' will build from an empty context with the
|
||||||
// contents of stdin as a Dockerfile
|
// contents of stdin as a Dockerfile
|
||||||
|
@ -169,7 +171,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
context, err = archive.Generate("Dockerfile", string(dockerfile))
|
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
|
isRemote = true
|
||||||
} else {
|
} else {
|
||||||
root := cmd.Arg(0)
|
root := cmd.Arg(0)
|
||||||
|
|
Loading…
Reference in a new issue