code: func FromArchive(tarStream io.Reader) (builder.Source, error) {
  	root, err := ioutils.TempDir("", "docker-builder")
  	if err != nil {
  		return nil, err
  	}
  
  	// Assume local file system. Since it's coming from a tar file.
  	tsc := &archiveContext{root: containerfs.NewLocalContainerFS(root)}
  
  	// Make sure we clean-up upon error.  In the happy case the caller
  	// is expected to manage the clean-up
  	defer func() {
  		if err != nil {
  			tsc.Close()
  		}
  	}()
  
  	decompressedStream, err := archive.DecompressStream(tarStream)
  	if err != nil {
  		return nil, err
  	}
  
  	sum, err := tarsum.NewTarSum(decompressedStream, true, tarsum.Version1)
  	if err != nil {
  		return nil, err
  	}
  
  	err = chrootarchive.Untar(sum, root, nil)
  	if err != nil {
  		return nil, err
  	}
  
  	tsc.sums = sum.GetSums()
  	return tsc, nil
  }
docs: // FromArchive returns a build source from a tar stream.
  //
  // It extracts the tar stream to a temporary folder that is deleted as soon as
  // the Context is closed.
  // As the extraction happens, a tarsum is calculated for every file, and the set of
  // all those sums then becomes the source of truth for all operations on this Context.
  //
  // Closing tarStream has to be done by the caller.