Skip to content

Commit

Permalink
Add pull method
Browse files Browse the repository at this point in the history
  • Loading branch information
crosbymichael committed May 7, 2014
1 parent ce1770c commit 59633a5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dockerclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,13 @@ func (client *DockerClient) Version() (*Version, error) {
}
return version, nil
}

func (client *DockerClient) PullImage(name, tag string) error {
v := url.Values{}
v.Set("fromImage", name)
if tag != "" {
v.Set("tag", tag)
}
_, err := client.doRequest("POST", "/v1.10/images/create?="+v.Encode(), nil)
return err
}

0 comments on commit 59633a5

Please sign in to comment.