mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #2984 from SvenDowideit/2319-build-check-for-dockerfile
check on the client side that there is a Dockerfile
This commit is contained in:
commit
5f2313aad3
1 changed files with 4 additions and 0 deletions
|
@ -195,6 +195,10 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
|
|||
if _, err := os.Stat(cmd.Arg(0)); err != nil {
|
||||
return err
|
||||
}
|
||||
filename := path.Join(cmd.Arg(0), "Dockerfile")
|
||||
if _, err = os.Stat(filename); os.IsNotExist(err) {
|
||||
return fmt.Errorf("no Dockerfile found in %s", cmd.Arg(0))
|
||||
}
|
||||
context, err = archive.Tar(cmd.Arg(0), archive.Uncompressed)
|
||||
}
|
||||
var body io.Reader
|
||||
|
|
Loading…
Reference in a new issue