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

Support creating and pushing OCI types #467

Merged
merged 1 commit into from
Jun 28, 2018

Conversation

dmcgowan
Copy link
Member

@dmcgowan dmcgowan commented Jun 26, 2018

Adds image exporter option "oci".
Ensures that the images created in the content store have the correct type which matches the manifest.
Sets the correct media type on the descriptor in push from reading the type specified in the manifest.
Removes use of distribution manifest packages.

Needed for testing distribution/distribution#2076
A registry with that PR can be used with this change to push OCI manifests

Using

$ buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=. --exporter=image --exporter-opt name=localregistry:5000/alpine:custom --exporter-opt push=true --exporter-opt oci=true

@@ -612,11 +611,15 @@ func testBuildPushAndValidate(t *testing.T, sb integration.Sandbox) {
dt, err = content.ReadBlob(ctx, img.ContentStore(), img.Target())
require.NoError(t, err)

var mfst schema2.Manifest
var msft = struct {

Choose a reason for hiding this comment

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

mfst?

Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

Can we have the exporter opt called oci-mediatypes=true|false so it isn't confusing with the oci/docker exporter names. And also expose the opt to the oci/docker exporter because currently it still makes sense to use the oci layout but without the types(for example when working with containerd). The default can be based on the exporter name.

fyi @northtyphoon (#424)

@@ -41,7 +41,7 @@ type ImageWriter struct {
opt WriterOpt
}

func (ic *ImageWriter) Commit(ctx context.Context, ref cache.ImmutableRef, config []byte) (*ocispec.Descriptor, error) {
func (ic *ImageWriter) Commit(ctx context.Context, ref cache.ImmutableRef, config []byte, OCI bool) (*ocispec.Descriptor, error) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: don't capitalize oci here

@AkihiroSuda
Copy link
Member

@tonistiigi
Copy link
Member

@AkihiroSuda It is using it https://github.com/dmcgowan/buildkit/blob/8e5cc5f0075b84cd6bdfc26b4530a3dc0a776d29/exporter/oci/export.go#L142

Adds image and oci exporter option "oci-mediatypes"
Ensures that the images created in the content store
have the correct type which matches the manifest.
Sets the correct media type on the descriptor in push from
reading the type specified in the manifest.
Removes use of distribution manifest packages.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

LGTM

@tonistiigi tonistiigi merged commit f3b743b into moby:master Jun 28, 2018
crazy-max pushed a commit to crazy-max/buildkit that referenced this pull request Jun 8, 2022
Add docs for Dockerfile ADD/COPY --chown flag
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.

4 participants