github.com/lazyboychen7/engine@v17.12.1-ce-rc2+incompatible/cli/config/configdir.go (about)

     1  package config
     2  
     3  import (
     4  	"os"
     5  	"path/filepath"
     6  
     7  	"github.com/docker/docker/pkg/homedir"
     8  )
     9  
    10  var (
    11  	configDir     = os.Getenv("DOCKER_CONFIG")
    12  	configFileDir = ".docker"
    13  )
    14  
    15  // Dir returns the path to the configuration directory as specified by the DOCKER_CONFIG environment variable.
    16  // TODO: this was copied from cli/config/configfile and should be removed once cmd/dockerd moves
    17  func Dir() string {
    18  	return configDir
    19  }
    20  
    21  func init() {
    22  	if configDir == "" {
    23  		configDir = filepath.Join(homedir.Get(), configFileDir)
    24  	}
    25  }