code: func ManifestFromImage(rs io.ReadSeeker) (*schema.ImageManifest, error) {
  	var im schema.ImageManifest
  
  	tr, err := NewCompressedTarReader(rs)
  	if err != nil {
  		return nil, err
  	}
  	defer tr.Close()
  
  	for {
  		hdr, err := tr.Next()
  		switch err {
  		case io.EOF:
  			return nil, errors.New("missing manifest")
  		case nil:
  			if filepath.Clean(hdr.Name) == ManifestFile {
  				data, err := ioutil.ReadAll(tr)
  				if err != nil {
  					return nil, err
  				}
  				if err := im.UnmarshalJSON(data); err != nil {
  					return nil, err
  				}
  				return &im, nil
  			}
  		default:
  			return nil, fmt.Errorf("error extracting tarball: %v", err)
  		}
  	}
  }
docs: // ManifestFromImage extracts a new schema.ImageManifest from the given ACI image.