mirror of
https://github.com/docker/cli.git
synced 2026-09-24 07:25:07 -05:00
Merge pull request #1752 from dotcloud/1750-build_error-fix
fix error in docker build when param is not a directory Upstream-commit: 969e48dd5a7c6969c9169c654aef8557ea860bd5 Component: engine
This commit is contained in:
@@ -187,8 +187,10 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
|
||||
} else if utils.IsURL(cmd.Arg(0)) || utils.IsGIT(cmd.Arg(0)) {
|
||||
isRemote = true
|
||||
} else {
|
||||
if _, err := os.Stat(cmd.Arg(0)); err != nil {
|
||||
if fi, err := os.Stat(cmd.Arg(0)); err != nil {
|
||||
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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user