image/save: Fix layers order in OCI manifest
Order the layers in OCI manifest by their actual apply order. This is required by the OCI image spec. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
4979605212
commit
17fd6562bf
1 changed files with 3 additions and 1 deletions
|
@ -210,7 +210,9 @@ func (s *saveSession) save(outStream io.Writer) error {
|
|||
foreign = make([]ocispec.Descriptor, 0, len(foreignSrcs))
|
||||
)
|
||||
|
||||
for _, desc := range foreignSrcs {
|
||||
// Layers in manifest must follow the actual layer order from config.
|
||||
for _, l := range imageDescr.layers {
|
||||
desc := foreignSrcs[l]
|
||||
foreign = append(foreign, ocispec.Descriptor{
|
||||
MediaType: desc.MediaType,
|
||||
Digest: desc.Digest,
|
||||
|
|
Loading…
Reference in a new issue