code: func (d *stiDocker) UploadToContainerWithTarWriter(fs fs.FileSystem, src, dest, container string, makeTarWriter func(io.Writer) s2itar.Writer) error {
  	destPath := filepath.Dir(dest)
  	r, w := io.Pipe()
  	go func() {
  		tarWriter := makeTarWriter(w)
  		tarWriter = s2itar.RenameAdapter{Writer: tarWriter, Old: filepath.Base(src), New: filepath.Base(dest)}
  
  		err := s2itar.New(fs).CreateTarStreamToTarWriter(src, true, tarWriter, nil)
  		if err == nil {
  			err = tarWriter.Close()
  		}
  
  		w.CloseWithError(err)
  	}()
  	glog.V(3).Infof("Uploading %q to %q ...", src, destPath)
  	ctx, cancel := getDefaultContext()
  	defer cancel()
  	err := d.client.CopyToContainer(ctx, container, destPath, r, dockertypes.CopyToContainerOptions{})
  	if err != nil {
  		glog.V(0).Infof("error: Uploading to container failed: %v", err)
  	}
  	return err
  }
docs: // UploadToContainerWithTarWriter uploads artifacts to the container.
  // If the source is a directory, then all files and sub-folders are copied into
  // the destination (which has to be directory as well).
  // If the source is a single file, then the file copied into destination (which
  // has to be full path to a file inside the container).