'Read the config from docker_daemon.yaml'

def get_check_config(self):

    from util import check_yaml
    from utils.checkfiles import get_conf_path
    (init_config, instances) = ({}, [])
    try:
        conf_path = get_conf_path(CHECK_NAME)
    except IOError:
        log.debug("Couldn't    find    docker    settings,    trying    with    defaults.")
        return (init_config, {})
    if ((conf_path is not None) and os.path.exists(conf_path)):
        try:
            check_config = check_yaml(conf_path)
            (init_config, instances) = (check_config.get('init_config', {}), check_config['instances'])
            init_config = ({} if (init_config is None) else init_config)
        except Exception:
            log.exception('Docker    check    configuration    file    is    invalid.    The    docker    check    and    other    Docker    related    components    will    not    work.')
            (init_config, instances) = ({}, [])
    if (len(instances) > 0):
        instance = instances[0]
    else:
        instance = {}
        log.error('No    instance    was    found    in    the    docker    check    configuration.    Docker    related    collection    will    not    work.')
    return (init_config, instance)
