@@ -41,7 +41,6 @@ import (
4141 "github.com/docker/cli/cli/command"
4242 dockeropts "github.com/docker/cli/opts"
4343 "github.com/docker/docker/api/types/versions"
44- "github.com/docker/docker/pkg/ioutils"
4544 "github.com/moby/buildkit/client"
4645 "github.com/moby/buildkit/exporter/containerimage/exptypes"
4746 "github.com/moby/buildkit/frontend/subrequests"
@@ -238,7 +237,7 @@ func buildMetricAttributes(dockerCli command.Cli, driverType string, options *bu
238237 commandNameAttribute .String ("build" ),
239238 attribute .Stringer (string (commandOptionsHash ), & buildOptionsHash {
240239 buildOptions : options ,
241- configDir : confutil .ConfigDir (dockerCli ),
240+ cfg : confutil .NewConfig (dockerCli ),
242241 }),
243242 driverNameAttribute .String (options .builder ),
244243 driverTypeAttribute .String (driverType ),
@@ -250,7 +249,7 @@ func buildMetricAttributes(dockerCli command.Cli, driverType string, options *bu
250249// the fmt.Stringer interface.
251250type buildOptionsHash struct {
252251 * buildOptions
253- configDir string
252+ cfg * confutil. Config
254253 result string
255254 resultOnce sync.Once
256255}
@@ -267,7 +266,7 @@ func (o *buildOptionsHash) String() string {
267266 if contextPath != "-" && osutil .IsLocalDir (contextPath ) {
268267 contextPath = osutil .ToAbs (contextPath )
269268 }
270- salt := confutil .TryNodeIdentifier (o .configDir )
269+ salt := confutil .TryNodeIdentifier (o .cfg )
271270
272271 h := sha256 .New ()
273272 for _ , s := range []string {target , contextPath , dockerfile , salt } {
@@ -374,7 +373,7 @@ func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions)
374373 desktop .PrintBuildDetails (os .Stderr , printer .BuildRefs (), term )
375374 }
376375 if options .imageIDFile != "" {
377- if err := os .WriteFile (options .imageIDFile , []byte (getImageID (resp .ExporterResponse )), 0644 ); err != nil {
376+ if err := osutil .WriteFile (options .imageIDFile , []byte (getImageID (resp .ExporterResponse )), 0644 ); err != nil {
378377 return errors .Wrap (err , "writing image ID file" )
379378 }
380379 }
@@ -742,7 +741,7 @@ func writeMetadataFile(filename string, dt interface{}) error {
742741 if err != nil {
743742 return err
744743 }
745- return ioutils .AtomicWriteFile (filename , b , 0644 )
744+ return osutil .AtomicWriteFile (filename , b , 0644 )
746745}
747746
748747func decodeExporterResponse (exporterResponse map [string ]string ) map [string ]interface {} {
0 commit comments