mirror of https://github.com/docker/docs.git
fix error in docker build when param is not a directory
This commit is contained in:
parent
2ea19238ff
commit
d605e82bad
|
@ -187,8 +187,10 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
|
||||||
} else if utils.IsURL(cmd.Arg(0)) || utils.IsGIT(cmd.Arg(0)) {
|
} else if utils.IsURL(cmd.Arg(0)) || utils.IsGIT(cmd.Arg(0)) {
|
||||||
isRemote = true
|
isRemote = true
|
||||||
} else {
|
} else {
|
||||||
if _, err := os.Stat(cmd.Arg(0)); err != nil {
|
if fi, err := os.Stat(cmd.Arg(0)); err != nil {
|
||||||
return err
|
return err
|
||||||
|
} else if !fi.IsDir() {
|
||||||
|
return fmt.Errorf("\"%s\" is not a path or URL. Please provide a path to a directory containing a Dockerfile.", cmd.Arg(0))
|
||||||
}
|
}
|
||||||
context, err = Tar(cmd.Arg(0), Uncompressed)
|
context, err = Tar(cmd.Arg(0), Uncompressed)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue