What does the DOCKER_TLS_VERIFY and DOCKER_CERT_PATH variable do?

前端 未结 2 964
遇见更好的自我
遇见更好的自我 2021-02-05 23:48

I am new to Docker, using boot2docker on Windows 7.
While I was trying to configure Docker build through spotify maven plugin, I was asked to set below env variables :

2条回答
  •  一个人的身影
    2021-02-06 00:34

    Please check below comments for now. I'm not a Go developer but I understand usage from it. To be edited later as it is too Spartan.

    from https://github.com/docker/docker/blob/3ea762b9f6ba256cf51bd2c35988f0c48bccf0b0/client/client.go

    [...]
    // Use DOCKER_HOST to set the url to the docker server.
    // Use DOCKER_API_VERSION to set the version of the API to reach, leave empty for latest.
    // Use DOCKER_CERT_PATH to load the tls certificates from.
    // Use DOCKER_TLS_VERIFY to enable or disable TLS verification, off by default.
    func NewEnvClient() (*Client, error) {
        var client *http.Client
        if dockerCertPath := os.Getenv("DOCKER_CERT_PATH"); dockerCertPath != "" {
            options := tlsconfig.Options{
                CAFile:             filepath.Join(dockerCertPath, "ca.pem"),
                CertFile:           filepath.Join(dockerCertPath, "cert.pem"),
                KeyFile:            filepath.Join(dockerCertPath, "key.pem"),
                InsecureSkipVerify: os.Getenv("DOCKER_TLS_VERIFY") == "",
    [...]
    

提交回复
热议问题