MCPcopy Create free account
hub / github.com/docker/cli / CertsDir

Function CertsDir

internal/registry/config.go:86–96  ·  view source on GitHub ↗

CertsDir is the directory where certificates are stored. - Linux: "/etc/docker/certs.d/" - Linux (with rootlessKit): $XDG_CONFIG_HOME/docker/certs.d/" or "$HOME/.config/docker/certs.d/" - Windows: "%PROGRAMDATA%/docker/certs.d/" TODO(thaJeztah): certsDir but stored in our config, and passed when n

()

Source from the content-addressed store, hash-verified

84//
85// TODO(thaJeztah): certsDir but stored in our config, and passed when needed. For the CLI, we should also default to same path as rootless.
86func CertsDir() string {
87 certsDir := "/etc/docker/certs.d"
88 if runningWithRootlessKit() {
89 if configHome, _ := os.UserConfigDir(); configHome != "" {
90 certsDir = filepath.Join(configHome, "docker", "certs.d")
91 }
92 } else if runtime.GOOS == "windows" {
93 certsDir = filepath.Join(os.Getenv("programdata"), "docker", "certs.d")
94 }
95 return certsDir
96}
97
98// newServiceConfig creates a new service config with the given options.
99func newServiceConfig(registries []string) (*serviceConfig, error) {

Callers 1

hostCertsDirFunction · 0.85

Calls 1

runningWithRootlessKitFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…