code: func writeManifest(cfg CommonConfig, img types.Hash, dest string) error {
  	mb, err := cfg.Store.GetImageManifestJSON(img.String())
  	if err != nil {
  		return err
  	}
  
  	debug("Writing image manifest")
  	if err := ioutil.WriteFile(filepath.Join(dest, "manifest"), mb, common.DefaultRegularFilePerm); err != nil {
  		return errwrap.Wrap(errors.New("error writing image manifest"), err)
  	}
  
  	return nil
  }
docs: // writeManifest takes an img ID and writes the corresponding manifest in dest