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>
(cherry picked from commit 17fd6562bf
)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
4d287e9267
commit
1e335cfa74
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…
Add table
Reference in a new issue