The Fast & Furious 5 actor and former WWE star was previously touted as a possible lead for the film, and has now joined the cast, reports Variety.
Filming for the epic movie will begin in New Zealand from October.
The project is written by Ryan Condal, who has adapted Steve Moore's 2008 graphic novel Hercules: The Thracian War.
Johnson recently revealed that the upcoming sixth instalment of the Fast & Furious franchise will start shooting in May.
He will return as The Rock for Wrestlemania 28 on April 1, which will air live from Miami on pay-per-view in the US.
Watch Dwayne Johnson in the trailer for GI Joe: Retaliation below: