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:
parent
d9cdd45d2e
commit
26cf8b9aff
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