def build_from_path(path)
      if !File.directory?(path) && File.basename(path) == 'Dockerfile'
        path = File.dirname(path)
      end
      File.directory?(path) ? build_from_dir(path) : build_from_file(path)
    end
def build_from_path(path)
      if !File.directory?(path) && File.basename(path) == 'Dockerfile'
        path = File.dirname(path)
      end
      File.directory?(path) ? build_from_dir(path) : build_from_file(path)
    end
Builds the image from a directory or a file.

 It also saves the generated image in the object internally.

 @param path [String] The path.

 @return void

 @api private