I think the shortest ferry is Fishguard/Rosslare, which takes around 6 hours if memory serves me well. Can't remember how much it cost us.
Of course, you've then got the drive to Fishguard and Rosslare-Cork to deal with...
One piece of advice: pay the extra for a cabin so you can get some kip! It's worth it.