All passengers have been accounted for after a cargo ship collided with a docked cruise ship.