code: func (f *Fetcher) FetchImage(d dist.Distribution, image, ascPath string) (*types.Hash, error) {
  	ensureLogger(f.Debug)
  	db := &distBundle{
  		dist:  d,
  		image: image,
  	}
  	a := f.getAsc(ascPath)
  	hash, err := f.fetchSingleImage(db, a)
  	if err != nil {
  		return nil, err
  	}
  	if f.WithDeps {
  		err = f.fetchImageDeps(hash)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	// we need to be able to do a chroot and access to the tree store
  	// directories, we need to
  	// 1) check if the system supports OverlayFS
  	// 2) check if we're root
  	if common.SupportsOverlay() == nil && os.Geteuid() == 0 {
  		if _, _, err := f.Ts.Render(hash, false); err != nil {
  			return nil, errwrap.Wrap(errors.New("error rendering tree store"), err)
  		}
  	}
  	h, err := types.NewHash(hash)
  	if err != nil {
  		// should never happen
  		log.PanicE("invalid hash", err)
  	}
  	return h, nil
  }
docs: // FetchImage will take an image as either a path, a URL or a name
  // string and import it into the store if found. If ascPath is not "",
  // it must exist as a local file and will be used as the signature
  // file for verification, unless verification is disabled. If
  // f.WithDeps is true also image dependencies are fetched.