mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
d9a62c5f2b
Signed-off-by: David Calavera <david.calavera@gmail.com>
18 lines
424 B
Go
18 lines
424 B
Go
package lib
|
|
|
|
import (
|
|
"io"
|
|
"net/url"
|
|
)
|
|
|
|
// ContainerExport retrieves the raw contents of a container
|
|
// and returns them as a io.ReadCloser. It's up to the caller
|
|
// to close the stream.
|
|
func (cli *Client) ContainerExport(containerID string) (io.ReadCloser, error) {
|
|
serverResp, err := cli.get("/containers/"+containerID+"/export", url.Values{}, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return serverResp.body, nil
|
|
}
|