Quote from Wikipedia:
Ronald Lee Ermey (March 24, 1944 – April 15, 2018) was an American Marine, actor, and voice actor. He achieved fame when he played Gunnery Sergeant Hartman in the 1987 film Full Metal Jacket, which earned him a Golden Globe Award nomination for Best Supporting Actor. Ermey was also a United States Marine Corps staff sergeant and an honorary gunnery sergeant. During his tenure in the U.S. Marine Corps, he served as a drill instructor.
Ermey was cast in his first film while attending the University of Manila in the Philippines, using his G.I. Bill benefits. He played a First Air Cavalry chopper pilot in Apocalypse Now, doubling as a technical advisor to director Francis Ford Coppola. Ermey then was cast as a Marine drill instructor in Sidney Furie's The Boys in Company C.
For the next few years, Ermey played a series of minor film roles until 1987, when he was cast as drill instructor Gunnery Sergeant Hartman in Stanley Kubrick's Full Metal Jacket. Initially, he was intended to be only the technical advisor. Kubrick changed his mind after Ermey put together an instructional tape, in which he went on an extended tirade towards several extras, convincing Kubrick he was the right man for the role. Seeking authenticity for the film, Kubrick allowed Ermey to write or edit his own dialogue and improvise on the set, a notable rarity in a Kubrick film. Kubrick later indicated that Ermey was an excellent performer, often needing just two or three takes per scene, also unusual for a Kubrick film. Ermey's performance won critical raves and he was nominated for a Golden Globe Award as Best Supporting Actor.