func GetRenderedACIFromList(imgs Images, ap ACIProvider) (RenderedACI, error) {
	if len(imgs) == 0 {
		return nil, fmt.Errorf("image list empty")
	}
	allFiles := make(map[string]byte)
	renderedACI := RenderedACI{}
	first := true
	for i, img := range imgs {
		pwlm := getUpperPWLM(imgs, i)
		ra, err := getACIFiles(img, ap, allFiles, pwlm)
		if err != nil {
			return nil, err
		}
		if first {
			ra.FileMap["manifest"] = struct{}{}
			first = false
		}
		renderedACI = append(renderedACI, ra)
	}
	return renderedACI, nil
}
GetRenderedACIFromList returns the RenderedACI list. All file outside rootfs
are excluded (at the moment only "manifest").
package acirenderer
import (
	"archive/tar"
	"crypto/sha512"
	"fmt"
	"hash"
	"io"
	"io/ioutil"
	"path/filepath"
	"strings"
	"github.com/appc/spec/schema"
	"github.com/appc/spec/schema/types"
)
type ACIRegistry interface {
	ACIProvider
	GetImageManifest(key string) (*schema.ImageManifest, error)
	GetACI(name types.ACIdentifier, labels types.Labels) (string, error)
}
type ACIProvider interface {
	ReadStream(key string) (io.ReadCloser, error)
	ResolveKey(key string) (string, error)
	HashToKey(h hash.Hash) string
}
type Image struct {
	Im    *schema.ImageManifest
	Key   string
	Level uint16
}
type Images []Image
type ACIFiles struct {
	Key     string
	FileMap map[string]struct{}
}
type RenderedACI []*ACIFiles
func GetRenderedACIWithImageID(imageID types.Hash, ap ACIRegistry) (RenderedACI, error) {
	imgs, err := CreateDepListFromImageID(imageID, ap)
	if err != nil {
		return nil, err
	}
	return GetRenderedACIFromList(imgs, ap)
}
func GetRenderedACI(name types.ACIdentifier, labels types.Labels, ap ACIRegistry) (RenderedACI, error) {
	imgs, err := CreateDepListFromNameLabels(name, labels, ap)
	if err != nil {
		return nil, err
	}
	return GetRenderedACIFromList(imgs, ap)
}