manifest/docker_schema1.go
func Schema1FromManifest(manifest []byte) (*Schema1, error) {
	s1 := Schema1{}
	if err := json.Unmarshal(manifest, &s1); err != nil {
		return nil, err
	}
	if s1.SchemaVersion != 1 {
		return nil, errors.Errorf("unsupported schema version %d", s1.SchemaVersion)
	}
	if err := s1.initialize(); err != nil {
		return nil, err
	}
	if err := s1.fixManifestLayers(); err != nil {
		return nil, err
	}
	return &s1, nil
}
func Schema1FromManifest(manifest []byte) (*Schema1, error) {
	s1 := Schema1{}
	if err := json.Unmarshal(manifest, &s1); err != nil {
		return nil, err
	}
	if s1.SchemaVersion != 1 {
		return nil, errors.Errorf("unsupported schema version %d", s1.SchemaVersion)
	}
	if err := s1.initialize(); err != nil {
		return nil, err
	}
	if err := s1.fixManifestLayers(); err != nil {
		return nil, err
	}
	return &s1, nil
}
// Schema1FromManifest creates a Schema1 manifest instance from a manifest blob.
// (NOTE: The instance is not necessary a literal representation of the original blob,
// layers with duplicate IDs are eliminated.)