def get_twindb_config_dir(client, container_id):
    """Read hostconfig of a container and return directory on a host server
    that is mounted as /etc/twindb in the container

    :param client: Docker client class instance
    :type client: APIClient
    :param container_id: container id. can be something like c870459a6724 or
        container name like builder_xtrabackup
    :return: directory on the host machine
    :rtype: str
    """
    api = client.api
    host_config = api.inspect_container(container_id)["HostConfig"]
    binds = host_config["Binds"]
    for bind_pair in binds:
        print(bind_pair)
        bind = bind_pair.split(":")
        host_dir = bind[0]
        guest_dir = bind[1]
        if guest_dir == "/etc/twindb":
            return host_dir
    raise RuntimeError("Could not find binding for /etc/twindb")