James Murnane (33) lunged at gardaí during the public order breach.
He had since turned his life around, was no longer drinking and was looking a lot better, a garda witness said.
Judge David McHugh imposed a three-month sentence which he suspended for a period of two years.
The defendant, with an address at Hazelcroft Park in Finglas, admitted public drunkenness and threatening and abusive behaviour at Supervalu, Seamus Ennis Road in Finglas on November 28, 2019.
A garda witness told Blanchardstown District Court that gardaí were called to the store at around 4.10pm. They spoke to the defendant who was shouting aggressively.
Murnane shouted “what the f**k are you doing, you f**kin’ fools” and “have you nothing better to be doing?”, the court heard.
The defendant lunged at gardaí and had to be restrained.
The court heard that Murnane had 60 previous convictions, the majority for public-order related matters.
Defence solicitor Sandra Frayne said this incident occurred almost three years ago, that Murnane had apologised for his behaviour and was a different person now.
Gardaí also agreed that Murnane was looking a lot better.
Mr Frayne said that Murnane had cleaned up his act since this incident.
She said the defendant had battled a problem with alcohol but was attending Alcoholics Anonymous meetings twice a week.
Murnane, a father of three, was living with an aunt, and was focused on staying out of trouble and continuing to rehabilitate himself.
Ms Frayne also asked the judge to be as lenient as possible and give the defendant one final chance.