示例#1
0
文件: docker.go 项目: willdr3/lingo
func (cfg *dockerBuildCfg) client() (*goDocker.Client, error) {
	if cfg.dockerClient == nil {
		var err error
		cfg.dockerClient, err = util.DockerClient()
		if err != nil {
			return nil, errors.Trace(err)
		}
	}

	return cfg.dockerClient, nil
}
示例#2
0
文件: docker.go 项目: howbazaar/lingo
func (d *Docker) getDockerClient() (*goDocker.Client, error) {
	if d.dockerClient == nil {
		dClient, err := util.DockerClient()
		if err != nil {
			return nil, errors.Trace(err)
		}
		d.dockerClient = dClient
	}

	return d.dockerClient, nil
}