Skip to content

containerd/save: Export only present platform manifests#33

Merged
vvoland merged 1 commit intorumpl:c8dfrom
vvoland:containerd-export-convert
Aug 5, 2022
Merged

containerd/save: Export only present platform manifests#33
vvoland merged 1 commit intorumpl:c8dfrom
vvoland:containerd-export-convert

Conversation

@vvoland
Copy link
Copy Markdown
Collaborator

@vvoland vvoland commented Jul 28, 2022

Follow-up to:

Changing load to import all platforms breaks the use case:

dockef pull busybox
docker save busybox > busybox.tar

# after docker image prune -a, or other daemon
docker load <busybox.tar

Because exporting the image (even with platform matcher) does export the whole manifest list referencing other platforms blobs (even if we don't have them).

Perhaps that's something that could be worked on upstream - for example adding the flag for Import to ignore importing the missing blobs? On the other hand the solution in this PR seems a bit better to me - because it feels wrong for the manifest in the archive to reference data it doesn't contain.

Signed-off-by: Paweł Gronowski pawel.gronowski@docker.com

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Comment thread daemon/containerd/save.go Outdated
return cs.client.Export(ctx, outStream, opts...)
}

func (cs *containerdStore) appendImageForExport(ctx context.Context, is containerdimages.Store, opts []archive.ExportOpt, name string) ([]archive.ExportOpt, error) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we don't really nee the is parameter, we can use cs.client.ImageService() directly

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@vvoland vvoland force-pushed the containerd-export-convert branch from f9b3d35 to 8a18209 Compare August 1, 2022 08:42
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland force-pushed the containerd-export-convert branch from 8a18209 to 53f123d Compare August 4, 2022 08:20
@vvoland vvoland changed the base branch from master to c8d August 4, 2022 08:20
@vvoland
Copy link
Copy Markdown
Collaborator Author

vvoland commented Aug 4, 2022

Rebased on the c8d branch

@thaJeztah
Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants