mirror of https://github.com/docker/docs.git
fixed bug with storage-path
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
5a86bad5fe
commit
fe912ae55a
2
main.go
2
main.go
|
@ -39,7 +39,7 @@ func main() {
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
EnvVar: "MACHINE_STORAGE_PATH",
|
EnvVar: "MACHINE_STORAGE_PATH",
|
||||||
Name: "storage-path",
|
Name: "storage-path",
|
||||||
Value: utils.GetBaseDir(),
|
Value: utils.GetMachineRoot(),
|
||||||
Usage: "Configures storage path",
|
Usage: "Configures storage path",
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
|
|
|
@ -22,7 +22,7 @@ func GetHomeDir() string {
|
||||||
func GetBaseDir() string {
|
func GetBaseDir() string {
|
||||||
baseDir := os.Getenv("MACHINE_STORAGE_PATH")
|
baseDir := os.Getenv("MACHINE_STORAGE_PATH")
|
||||||
if baseDir == "" {
|
if baseDir == "" {
|
||||||
baseDir = filepath.Join(GetHomeDir(), ".docker", "machine")
|
baseDir = filepath.Join(GetHomeDir(), ".docker")
|
||||||
}
|
}
|
||||||
return baseDir
|
return baseDir
|
||||||
}
|
}
|
||||||
|
@ -31,16 +31,20 @@ func GetDockerDir() string {
|
||||||
return filepath.Join(GetHomeDir(), ".docker")
|
return filepath.Join(GetHomeDir(), ".docker")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetMachineRoot() string {
|
||||||
|
return filepath.Join(GetBaseDir(), "machine")
|
||||||
|
}
|
||||||
|
|
||||||
func GetMachineDir() string {
|
func GetMachineDir() string {
|
||||||
return filepath.Join(GetBaseDir(), "machines")
|
return filepath.Join(GetMachineRoot(), "machines")
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetMachineCertDir() string {
|
func GetMachineCertDir() string {
|
||||||
return filepath.Join(GetBaseDir(), "certs")
|
return filepath.Join(GetMachineRoot(), "certs")
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetMachineCacheDir() string {
|
func GetMachineCacheDir() string {
|
||||||
return filepath.Join(GetBaseDir(), "cache")
|
return filepath.Join(GetMachineRoot(), "cache")
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetUsername() string {
|
func GetUsername() string {
|
||||||
|
|
Loading…
Reference in New Issue