コード例 #1
0
func newContainerDownloader(client *docker.Client, container, path string) io.ReadCloser {
	r, w := io.Pipe()

	go func() {
		opts := docker.DownloadFromContainerOptions{
			Path:         path,
			OutputStream: w,
		}
		w.CloseWithError(client.DownloadFromContainer(container, opts))
	}()

	return r
}