github.com/walkingsparrow/docker@v1.4.2-0.20151218153551-b708a2249bfa/api/client/lib/image_save.go (about) 1 package lib 2 3 import ( 4 "io" 5 "net/url" 6 ) 7 8 // ImageSave retrieves one or more images from the docker host as a io.ReadCloser. 9 // It's up to the caller to store the images and close the stream. 10 func (cli *Client) ImageSave(imageIDs []string) (io.ReadCloser, error) { 11 query := url.Values{ 12 "names": imageIDs, 13 } 14 15 resp, err := cli.get("/images/get", query, nil) 16 if err != nil { 17 return nil, err 18 } 19 return resp.body, nil 20 }