config_windows.go 741 B

1234567891011121314151617181920
  1. package registry // import "github.com/docker/docker/registry"
  2. import (
  3. "os"
  4. "path/filepath"
  5. "strings"
  6. )
  7. // defaultCertsDir is the platform-specific default directory where certificates
  8. // are stored. On Linux, it may be overridden through certsDir, for example, when
  9. // running in rootless mode.
  10. var defaultCertsDir = os.Getenv("programdata") + `\docker\certs.d`
  11. // cleanPath is used to ensure that a directory name is valid on the target
  12. // platform. It will be passed in something *similar* to a URL such as
  13. // https:\index.docker.io\v1. Not all platforms support directory names
  14. // which contain those characters (such as : on Windows)
  15. func cleanPath(s string) string {
  16. return filepath.FromSlash(strings.ReplaceAll(s, ":", ""))
  17. }