import shutil


def read_binary(shared_dir, output_file):
    """
    Read back binary file output from container into one string, not an
    iterable. Then remove the temporary parent directory the container
    mounted.

    :param shared_dir: temporary directory container mounted
    :param output_file: path to output file
    :return: str of file contents
    """

    with open(output_file, 'rb') as file_handle:
        output = file_handle.read()
    shutil.rmtree(shared_dir)
    return output