Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker exporter #228

Merged
merged 1 commit into from
Dec 19, 2017
Merged

Add Docker exporter #228

merged 1 commit into from
Dec 19, 2017

Conversation

tonistiigi
Copy link
Member

@tonistiigi tonistiigi commented Dec 18, 2017

buildctl build ... --exporter=docker --exporter-opt name=myimage | docker load

The exported tarball is compatible with Docker v1.10 and newer. Older versions that only accept the v1.0 tarball will not work.

The tarball is also fully compatible with OCI. We can figure out later if containerd upstream is also interested of any of this code and in what way and what packages should contain what code(related to #215). My current thinking is that special package for exporter/oci is not needed and different variants can all be under containerimage.

based on #227

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

SGTM, but containerd/CRI-containerd Docker v1 importer does not support loading this manifest yet: https://github.com/kubernetes-incubator/cri-containerd/blob/b88315707238082397a9475af0663bd1c432b7a3/pkg/containerd/importer/importer.go#L55-L65

@tonistiigi
Copy link
Member Author

@AkihiroSuda We should create an issue to get this fixed. v1.1 does not specify any mandatory paths for these files, they are only in certain locations if v1.0 compatibility is needed.

@AkihiroSuda
Copy link
Member

This PR sets "org.opencontainers.image.ref.name" to "docker.io/library/myimage:latest", but AFAIK most implementation does not expect docker.io/library/myimage: portion to be included here.

@AkihiroSuda
Copy link
Member

For Docker v1 manifest.json, can we allow setting multiple repotags?

@tonistiigi
Copy link
Member Author

tonistiigi commented Dec 18, 2017

This PR sets "org.opencontainers.image.ref.name" to "docker.io/library/myimage:latest", but AFAIK most implementation does not expect docker.io/library/myimage: portion to be included here.

Don't they expect a valid reference there? I'd think myimage itself is not a valid reference but rather than erroring, we support expanding it to a valid reference if the user only typed a short version that is common in docker UI.

For Docker v1 manifest.json, can we allow setting multiple repotags?

The format supports them but we would need a way to pass that with exporter opts. Is it a common use case?

@AkihiroSuda
Copy link
Member

Don't they expect a valid reference there? I'd think myimage itself is not a valid reference but rather than erroring, we support expanding it to a valid reference if the user only typed a short version that is common in docker UI.

Having a valid reference is 100% correct, but not "common": https://github.com/opencontainers/image-spec/blob/7c889fafd04a893f5c5f50b7ab9963d5d64e5242/image-layout.md

Implementor's Note: A common use case of descriptors with a "org.opencontainers.image.ref.name" annotation is representing a "tag" for a container image. For example, an image may have a tag for different versions or builds of the software. In the wild you often see "tags" like "v1.0.0-vendor.0", "2.0.0-debug", etc. Those tags will often be represented in an image-layout repository with matching "org.opencontainers.image.ref.name" annotations like "v1.0.0-vendor.0", "2.0.0-debug", etc.

So, having a reference value is likely to cause compatibility issues with other OCI implementations. (Such implementations should be blamed though 😄 )

@tonistiigi
Copy link
Member Author

I think I misunderstood the meaning of org.opencontainers.image.ref.name. By my definition it doesn't make any sense to have a ref name that is v1.0. This is a version (a tag) not a name. Do I revert this(and #227) and only leave Docker RepoTags?

@tonistiigi tonistiigi force-pushed the docker-exporter branch 2 times, most recently from 566344d to c9778ab Compare December 18, 2017 20:06
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi
Copy link
Member Author

Updated

@AkihiroSuda AkihiroSuda merged commit 2822846 into moby:master Dec 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants