2017-06-01 16:34:31 -04:00
|
|
|
package config
|
2017-04-17 19:18:46 -04:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
"github.com/docker/docker/pkg/homedir"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
configDir = os.Getenv("DOCKER_CONFIG")
|
|
|
|
configFileDir = ".docker"
|
|
|
|
)
|
|
|
|
|
2017-06-01 16:34:31 -04:00
|
|
|
// Dir returns the path to the configuration directory as specified by the DOCKER_CONFIG environment variable.
|
2017-04-17 19:18:46 -04:00
|
|
|
// TODO: this was copied from cli/config/configfile and should be removed once cmd/dockerd moves
|
2017-06-01 16:34:31 -04:00
|
|
|
func Dir() string {
|
2017-04-17 19:18:46 -04:00
|
|
|
return configDir
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
if configDir == "" {
|
|
|
|
configDir = filepath.Join(homedir.Get(), configFileDir)
|
|
|
|
}
|
|
|
|
}
|