Just be damn sure to fill in the old dryer vent hole, or the mice will swarm in. Nothing as aggravating as a pantry full of mouse turds and piss, and chewed up stuff.

2x4 shelf framing is overkill IMO, I use 2x2's to frame shelving in my garage and they see FAR more weight than a pantry ever will. Foodstuff and cans ain't that heavy.

I'd also recommend you consider making the shelf tops removable for easy cleaning, repainting, changing shelf paper, etc. Someday you may be glad you did, and you may regret nailing/screwing them down too.

And FWIW, you can get doors at Lowes or Home Depot that have a decorative glass panel in them that say "Pantry".