The former wrestler, who is now the world's highest-paid actor, said he, his wife and two daughters caught the virus despite being "disciplined" about health protection.
He said the positive tests were "a kick in the gut".
Now, he added, "we're on the other end of it and no longer contagious. Thank God, we're healthy."
Johnson, 48, said he. his wife Lauren, 35, and their daughters Jasmine and Tiana, aged four and two, contracted the virus about two-and-a-half weeks ago.
They caught it from "very close family friends" who, in turn, had no idea how they had been infected.
"I can tell you that this has been one of the most challenging and difficult things we have ever had to endure as a family," Johnson said in a video posted on his Instagram account.
"Testing positive for Covid-19 is much different than overcoming nasty injuries, or being evicted or even being broke, which I have been more than a few times," he added.
"My number one priority is to always protect my family."
"We are counting our blessings right now because we're well aware that it isn't always the case that you get on the other end of Covid-19 stronger and healthier," said Johnson.
"It baffles me that some people out there, including some politicians, will take this idea of wearing masks and make it part of a political agenda.
"It has nothing to do with politics. Wear your mask. It is a fact. And it is the right thing to do."
Dwayne Johnson followed his father Rocky to become a professional wrestler and a World Wrestling Entertainment (WWE) star.
He became a huge success in the sport before turning to acting, starring in blockbuster movies such as The Scorpion King, Fast & Furious 6 and the Jumanji franchise.
The former wrestler reportedly earned $87.5m (£67m) in the year to June, including $23.5m for the Netflix thriller Red Notice.