github.com/kinvolk/docker@v1.13.1/client/container_export.go (about)

     1  package client
     2  
     3  import (
     4  	"io"
     5  	"net/url"
     6  
     7  	"golang.org/x/net/context"
     8  )
     9  
    10  // ContainerExport retrieves the raw contents of a container
    11  // and returns them as an io.ReadCloser. It's up to the caller
    12  // to close the stream.
    13  func (cli *Client) ContainerExport(ctx context.Context, containerID string) (io.ReadCloser, error) {
    14  	serverResp, err := cli.get(ctx, "/containers/"+containerID+"/export", url.Values{}, nil)
    15  	if err != nil {
    16  		return nil, err
    17  	}
    18  
    19  	return serverResp.body, nil
    20  }