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
()
| 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. |
| 86 | func 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. |
| 99 | func newServiceConfig(registries []string) (*serviceConfig, error) { |
no test coverage detected
searching dependent graphs…