It's my understanding that they "pre-clear" you in all the countries you're entering on your cruise as part of your checkin to the cruiseline (but then again, I've only done Caribbean and Mexico cruises, none that are "real" international). All we do is slide our key-cards on the way off the ship, then slide them again on the way back on, and only deal with customs back home after getting off the ship.
Some folks with more of an international experience can talk about those, I'm sure.
I do know that the cruiselines need your passport information well in advance of your voyage for this reason.