image_load.go 395 B

1234567891011121314151617
  1. package lib
  2. import (
  3. "io"
  4. "net/url"
  5. )
  6. // ImageLoad loads an image in the docker host from the client host.
  7. // It's up to the caller to close the io.ReadCloser returned by
  8. // this function.
  9. func (cli *Client) ImageLoad(input io.Reader) (io.ReadCloser, error) {
  10. resp, err := cli.postRaw("/images/load", url.Values{}, input, nil)
  11. if err != nil {
  12. return nil, err
  13. }
  14. return resp.body, nil
  15. }