get authConfig from either docker or cli

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca
2016-01-21 11:07:25 +01:00
parent e240045aa9
commit be0a455d5b
2 changed files with 35 additions and 19 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
"github.com/docker/docker/cliconfig"
)
const (
@@ -34,7 +35,7 @@ func main() {
app.Flags = []cli.Flag{
cli.BoolFlag{
Name: "debug",
Usage: "enable debug output for logging",
Usage: "enable debug output",
},
cli.StringFlag{
Name: "username",
@@ -46,6 +47,11 @@ func main() {
Value: "",
Usage: "registry password",
},
cli.StringFlag{
Name: "docker-cfg",
Value: cliconfig.ConfigDir(),
Usage: "Docker's cli config for auth",
},
}
app.Before = func(c *cli.Context) error {
if c.GlobalBool("debug") {