1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

check on the client side that there is a Dockerfile, so we don't upload a huge stack of files, only to realise we can't do anything

This commit is contained in:
Sven Dowideit 2013-12-02 15:52:45 +10:00
parent d9cdd45d2e
commit 26cf8b9aff

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