diff --git a/cli/command/image/build/context.go b/cli/command/image/build/context.go index 1d3011aff6..463e3156c2 100644 --- a/cli/command/image/build/context.go +++ b/cli/command/image/build/context.go @@ -47,7 +47,7 @@ func ValidateContextDirectory(srcPath string, excludes []string) error { return errors.Errorf("can't stat '%s'", filePath) } if os.IsNotExist(err) { - return nil + return errors.Errorf("file ('%s') not found or excluded by .dockerignore", filePath) } return err }