import logging


def contains_valid_dockercfg(config):
    """
    Check if a given config dict contains valid dockercfg

    :param config: dict
    :return: True / False
    """
    docker_config = config.get('dockercfg')
    if not docker_config:
        return False
    if not isinstance(docker_config, dict):
        logging.warning("Check value of dockercfg to be a dict")
        return False
    else:
        return True