Skip to content

Commit be5b3a3

Browse files
committed
Use default cert dir for oc cluster up client if DOCKER_TLS_VERIFY is set
1 parent 6f7e2fd commit be5b3a3

File tree

1 file changed

+9
-0
lines changed
  • pkg/bootstrap/docker

1 file changed

+9
-0
lines changed

pkg/bootstrap/docker/up.go

+9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"runtime"
1010

1111
"github.com/blang/semver"
12+
"github.com/docker/docker/pkg/homedir"
1213
dockerclient "github.com/docker/engine-api/client"
1314
docker "github.com/fsouza/go-dockerclient"
1415
"github.com/golang/glog"
@@ -437,6 +438,14 @@ func getDockerClient(out io.Writer, dockerMachine string, canStartDockerMachine
437438
}
438439
if len(dockerTLSVerify) > 0 {
439440
glog.Infof("DOCKER_TLS_VERIFY=%s", dockerTLSVerify)
441+
if len(dockerCertPath) == 0 {
442+
home := homedir.Get()
443+
if home == "" {
444+
return nil, nil, errors.NewError("environment variable HOME must be set if DOCKER_CERT_PATH is not set")
445+
}
446+
dockerCertPath = filepath.Join(home, ".docker")
447+
os.Setenv("DOCKER_CERT_PATH", dockerCertPath)
448+
}
440449
}
441450
if len(dockerCertPath) > 0 {
442451
glog.Infof("DOCKER_CERT_PATH=%s", dockerCertPath)

0 commit comments

Comments
 (0)