github.com/docker/docker@v299999999.0.0-20200612211812-aaf470eca7b5+incompatible/registry/config_unix.go (about)

     1  // +build !windows
     2  
     3  package registry // import "github.com/docker/docker/registry"
     4  
     5  import (
     6  	"path/filepath"
     7  
     8  	"github.com/docker/docker/pkg/homedir"
     9  	"github.com/docker/docker/rootless"
    10  )
    11  
    12  // CertsDir is the directory where certificates are stored
    13  func CertsDir() string {
    14  	d := "/etc/docker/certs.d"
    15  
    16  	if rootless.RunningWithRootlessKit() {
    17  		configHome, err := homedir.GetConfigHome()
    18  		if err == nil {
    19  			d = filepath.Join(configHome, "docker/certs.d")
    20  		}
    21  	}
    22  	return d
    23  }
    24  
    25  // cleanPath is used to ensure that a directory name is valid on the target
    26  // platform. It will be passed in something *similar* to a URL such as
    27  // https:/index.docker.io/v1. Not all platforms support directory names
    28  // which contain those characters (such as : on Windows)
    29  func cleanPath(s string) string {
    30  	return s
    31  }