@@ -45,7 +45,7 @@ func (c *Client) Image(ctx context.Context, name string, options ...ImageOption)
45
45
46
46
// checkImage checks the docker host client if the image is known.
47
47
func (i * Image ) checkImageExists (ctx context.Context ) bool {
48
- res , err := i .client .ImageList (ctx , types.ImageListOptions {
48
+ res , err := i .client .Docker . ImageList (ctx , types.ImageListOptions {
49
49
Filters : NewFilter ("reference" , i .image ),
50
50
})
51
51
@@ -54,7 +54,7 @@ func (i *Image) checkImageExists(ctx context.Context) bool {
54
54
55
55
// buildImage builds a DockerFile tarball as a docker image.
56
56
func (i * Image ) buildImage (ctx context.Context ) error {
57
- imageBuildResponse , err := i .client .ImageBuild (
57
+ imageBuildResponse , err := i .client .Docker . ImageBuild (
58
58
ctx ,
59
59
i .buildTarball ,
60
60
types.ImageBuildOptions {
@@ -78,7 +78,7 @@ func (i *Image) buildImage(ctx context.Context) error {
78
78
79
79
// Pull retrieves latest changes to the image from docker hub.
80
80
func (i * Image ) Pull (ctx context.Context ) (* Image , error ) {
81
- reader , err := i .client .ImagePull (ctx , i .image , types.ImagePullOptions {})
81
+ reader , err := i .client .Docker . ImagePull (ctx , i .image , types.ImagePullOptions {})
82
82
if err != nil {
83
83
return i , errorClientPull (err )
84
84
}
@@ -137,7 +137,7 @@ func (i *Image) Instantiate(ctx context.Context, options ...ContainerOption) (*C
137
137
config .WorkingDir = c .workDir
138
138
}
139
139
140
- resp , err := c .image .client .ContainerCreate (ctx , config , & container.HostConfig {Mounts : mounts }, nil , nil , "" )
140
+ resp , err := c .image .client .Docker . ContainerCreate (ctx , config , & container.HostConfig {Mounts : mounts }, nil , nil , "" )
141
141
if err != nil {
142
142
return nil , errorContainerCreate (c .image .Name (), err )
143
143
}
@@ -148,13 +148,13 @@ func (i *Image) Instantiate(ctx context.Context, options ...ContainerOption) (*C
148
148
149
149
// Clean removes all docker images that match the given filter, and max age.
150
150
func (c * Client ) Clean (ctx context.Context , age time.Duration , filter filters.Args ) error {
151
- images , _ := c .ImageList (ctx , types.ImageListOptions {Filters : filter })
151
+ images , _ := c .Docker . ImageList (ctx , types.ImageListOptions {Filters : filter })
152
152
timeNow := time .Now ()
153
153
154
154
var err error
155
155
for _ , image := range images {
156
156
if time .Unix (image .Created , 0 ).Add (age ).Before (timeNow ) {
157
- if _ , _err := c .ImageRemove (ctx , image .ID , types.ImageRemoveOptions {
157
+ if _ , _err := c .Docker . ImageRemove (ctx , image .ID , types.ImageRemoveOptions {
158
158
Force : true ,
159
159
PruneChildren : true ,
160
160
}); _err != nil {
0 commit comments