add EnvVar to --registry switch (#81) (#82)

allows people to setup default registry in .bashrc and avoid typing it every time
This commit is contained in:
Matt Vinall 2018-03-19 15:18:01 +00:00 committed by Jess Frazelle
parent dfb6ef23f5
commit dd16b5bfef
2 changed files with 8 additions and 4 deletions

View file

@ -59,11 +59,14 @@ GLOBAL OPTIONS:
--force-non-ssl, -f force allow use of non-ssl
--username value, -u value username for the registry
--password value, -p value password for the registry
--registry value, -r value URL to the private registry (ex. r.j3ss.co) (default: "https://registry-1.docker.io")
--registry value, -r value URL to the private registry (ex. r.j3ss.co) (default: "https://registry-1.docker.io") [$REG_REGISTRY]
--help, -h show help
--version, -v print the version
```
Note that the `--registry` can be set by an environment variable `REG_REGISTRY`, so you can set this in your shell login scripts.
Specifying the registry on the command-line will override an environment variable setting.
## Auth
`reg` will automatically try to parse your docker config credentials, but if

View file

@ -48,9 +48,10 @@ func main() {
Usage: "password for the registry",
},
cli.StringFlag{
Name: "registry, r",
Usage: "URL to the private registry (ex. r.j3ss.co)",
Value: repoutils.DefaultDockerRegistry,
Name: "registry, r",
Usage: "URL to the private registry (ex. r.j3ss.co)",
Value: repoutils.DefaultDockerRegistry,
EnvVar: "REG_REGISTRY",
},
}