Firefighters from Barnsley, Cudworth, Tankersley, South Kirby, Dearne and Parkway stations were called to Ardagh Glass, on Burton Road, at 7.07pm.
There were no reports of any injuries.
A spokesperson for South Yorkshire Fire and Rescue said: “It was deemed to be accidental.
“There was some machinery involved and the fire spread to the roof void.”
Crews left the site at 8.20pm.