The film you're describing—where a teacher faces a student in a game of Russian roulette—is almost certainly 187 (1997), starring Samuel L. Jackson as Trevor Garfield, a teacher pushed to the brink in a violent Los Angeles high school. The climactic confrontation involves exactly that scenario.
Danny Glover is often associated with this genre due to Dangerous Minds (1995), but he plays the principal, not the classroom teacher (that's Michelle Pfeiffer). If you're certain the lead is Danny Glover, consider The Principal (1987) with Jim Belushi or The Substitute (1996) with Tom Berenger, though the Russian roulette scene is a hallmark of 187.