@@ -30,7 +30,6 @@ import (
3030
3131 "github.com/containers/image/docker"
3232 "github.com/containers/image/docker/tarfile"
33- "github.com/containers/image/types"
3433 "github.com/docker/docker/client"
3534
3635 "github.com/golang/glog"
@@ -134,23 +133,14 @@ func (p CloudPrepper) getFileSystem() (string, error) {
134133 return "" , err
135134 }
136135
137- // By default, the image library will try to look at /etc/docker/certs.d
138- // As a non-root user, this would result in a permissions error, so we avoid this
139- // by looking in a temporary directory we create in the container-diff home directory
140- cwd , _ := os .Getwd ()
141- tmpCerts , _ := ioutil .TempDir (cwd , "certs" )
142- defer os .RemoveAll (tmpCerts )
143- ctx := & types.SystemContext {
144- DockerCertPath : tmpCerts ,
145- }
146- img , err := ref .NewImage (ctx )
136+ img , err := ref .NewImage (nil )
147137 if err != nil {
148138 glog .Error (err )
149139 return "" , err
150140 }
151141 defer img .Close ()
152142
153- imgSrc , err := ref .NewImageSource (ctx , nil )
143+ imgSrc , err := ref .NewImageSource (nil , nil )
154144 if err != nil {
155145 glog .Error (err )
156146 return "" , err
@@ -184,16 +174,7 @@ func (p CloudPrepper) getConfig() (ConfigSchema, error) {
184174 return ConfigSchema {}, err
185175 }
186176
187- // By default, the image library will try to look at /etc/docker/certs.d
188- // As a non-root user, this would result in a permissions error, so we avoid this
189- // by looking in a temporary directory we create in the container-diff home directory
190- cwd , _ := os .Getwd ()
191- tmpCerts , _ := ioutil .TempDir (cwd , "certs" )
192- defer os .RemoveAll (tmpCerts )
193- ctx := & types.SystemContext {
194- DockerCertPath : tmpCerts ,
195- }
196- img , err := ref .NewImage (ctx )
177+ img , err := ref .NewImage (nil )
197178 if err != nil {
198179 glog .Errorf ("Error referencing image %s from registry: %s" , p .Source , err )
199180 return ConfigSchema {}, errors .New ("Could not obtain image config" )
0 commit comments