MCPcopy Create free account
hub / github.com/OpenSN-Library/OpenSN-Library / InitDockerClient

Function InitDockerClient

daemon/utils/docker.go:12–22  ·  view source on GitHub ↗
(sockPath string)

Source from the content-addressed store, hash-verified

10var DockerClient *dockerClient.Client
11
12func InitDockerClient(sockPath string) error {
13 url := fmt.Sprintf("unix://%s", sockPath)
14 cli, err := dockerClient.NewClientWithOpts(dockerClient.WithHost(url))
15
16 if err != nil {
17 logrus.Error("Init Docker Client Error:", err.Error())
18 return err
19 }
20 DockerClient = cli
21 return nil
22}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected