gopkg.in/docker/docker.v20@v20.10.27/registry/config_unix.go (about)

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