def _parse_volumes_kwarg(cli_style_volumes):
    """
    The Python API for mounting volumes is tedious.
    https://github.com/docker/docker-py/blob/master/docs/volumes.md
    This makes it work like the CLI
    """
    binds = {}
    volumes = []
    for volume in cli_style_volumes:
        split = volume.split(':')
        if len(split) == 1:
            volume.append(split[0])
            continue

        host_path = split[0]
        mountpoint = split[1]
        if len(split) == 3:
            read_only = split[2] == 'ro'
        else:
            read_only = False
        volumes.append(mountpoint)
        binds[host_path] = {'bind': mountpoint, 'ro': read_only}
    return volumes, binds