Glen Byrne (34) went on a "rampage", smashing 16 windows with a claw hammer at the west Dublin Credit Union.
He went on to break four more windows at a nearby convenience store and one at an apartment block, then confronted gardai after he was arrested.
The total cost of the damage was more than €6,000.
Byrne had his sentence suspended for two years and was fined €750.
The accused, with an address at Harelawn Avenue, Clondalkin, pleaded guilty to causing criminal damage to 16 panes of glass at Rowlagh Credit Union on June 15 this year.
He also admitted damaging four panes of glass at Supervalu, Ronanstown Road, one window at Chaplain's Place, public intoxication, causing a breach and unlawful possession of a claw hammer at Collinstown Road, Clondalkin.
Byrne admitted a further charge of violent behaviour at Ronanstown Garda Station.
Blanchardstown District Court heard when the accused was arrested, he told the garda: "f*** you, I'm going to go out in a blaze of glory". He had been abusive to staff at Finch's pub, telling a worker he was going to "smash his face in".
At the garda station, he turned around, faced an officer with both hands raised and became violent. He spent four to five hours "constantly banging the cell door".
Byrne had been arrested at 7am before being released on station bail. He then "got himself into severe difficulty".
The court heard the accused had been assaulted and suffered serious head injuries and "significant scarring".
He was living at home with his family in a "somewhat overcrowded residence" and the domestic situation was "somewhat difficult", Fiona Brennan, defending, said.