An Iraqi court has sentenced eight French nationals to life imprisonment for joining the Islamic State, with additional sentences given to two others.