in cli/configure-docker.go [66:90]
func (c *dockerConfigCmd) Execute(context.Context, *flag.FlagSet, ...interface{}) subcommands.ExitStatus {
binaryName := filepath.Base(os.Args[0])
if !strings.HasPrefix(binaryName, credHelperPrefix) {
printErrorln("Binary name must be prefixed with '%s': %s", credHelperPrefix, binaryName)
return subcommands.ExitFailure
}
// the Docker client can only use binaries on the $PATH
if _, err := exec.LookPath(binaryName); err != nil {
printErrorln("'%s' must exist on your PATH", binaryName)
return subcommands.ExitFailure
}
dockerConfig, err := cliconfig.Load("")
if err != nil {
printErrorln("Unable to load docker config: %v", err)
return subcommands.ExitFailure
}
// 'credsStore' and 'credHelpers' take the suffix of the credential helper
// binary.
credHelperSuffix := binaryName[len(credHelperPrefix):]
return c.setConfig(dockerConfig, credHelperSuffix)
}