Example #1
0
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
}
Example #2
0
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
}