here is another link to answer your question:
Naples has an ancient town. From the cruise port you may take a taxi to the central station. From there you will be in about half an hour at Pompeji . You can take the same train afterwards to go to Sorrento. Than take the bus for Amalfi. Back to ship with the hydrofoil.