code: func Compress(buildCtx io.ReadCloser) (io.ReadCloser, error) {
  	pipeReader, pipeWriter := io.Pipe()
  
  	go func() {
  		compressWriter, err := archive.CompressStream(pipeWriter, archive.Gzip)
  		if err != nil {
  			pipeWriter.CloseWithError(err)
  		}
  		defer buildCtx.Close()
  
  		if _, err := pools.Copy(compressWriter, buildCtx); err != nil {
  			pipeWriter.CloseWithError(
  				errors.Wrap(err, "failed to compress context"))
  			compressWriter.Close()
  			return
  		}
  		compressWriter.Close()
  		pipeWriter.Close()
  	}()
  
  	return pipeReader, nil
  }
docs: // Compress the build context for sending to the API