1
0
Fork 0
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:
Guillaume J. Charmes 2013-12-02 09:35:31 -08:00
commit 5f2313aad3

View file

@ -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