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