code: func (de *DockerExporter) Export(ctx context.Context, store content.Provider, desc ocispec.Descriptor, writer io.Writer) error {
  	tw := tar.NewWriter(writer)
  	defer tw.Close()
  
  	dockerManifest, err := dockerManifestRecord(ctx, store, desc, de.Names)
  	if err != nil {
  		return err
  	}
  
  	records := []tarRecord{
  		ociLayoutFile(""),
  		ociIndexRecord(desc),
  		*dockerManifest,
  	}
  
  	algorithms := map[string]struct{}{}
  	exportHandler := func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
  		records = append(records, blobRecord(store, desc))
  		algorithms[desc.Digest.Algorithm().String()] = struct{}{}
  		return nil, nil
  	}
  
  	// Get all the children for a descriptor
  	childrenHandler := images.ChildrenHandler(store)
  
  	handlers := images.Handlers(
  		childrenHandler,
  		images.HandlerFunc(exportHandler),
  	)
  
  	// Walk sequentially since the number of fetchs is likely one and doing in
  	// parallel requires locking the export handler
  	if err := images.Walk(ctx, handlers, desc); err != nil {
  		return err
  	}
  
  	if len(algorithms) > 0 {
  		records = append(records, directoryRecord("blobs/", 0755))
  		for alg := range algorithms {
  			records = append(records, directoryRecord("blobs/"+alg+"/", 0755))
  		}
  	}
  
  	return writeTar(ctx, tw, records)
  }
docs: // Export exports tarball into writer.