code: func (e *fileExtractor) copyFile(ctx context.Context, containerID, path string) ([]byte, error) {
  	var buf bytes.Buffer
  	if err := e.client.CopyFromContainer(ctx, docker.CopyFromContainerOptions{
  		Container:    containerID,
  		Resource:     path,
  		OutputStream: &buf,
  	}); err != nil {
  		return nil, err
  	}
  
  	// Open the tar archive for reading.
  	r := bytes.NewReader(buf.Bytes())
  
  	return firstFile(tar.NewReader(r))
  }
docs: // copyFile copies a file from a container.