This would be my advice, given your time constraints. Trust public transport in Vienna, not only it is safe, you will be faster than going by taxi, even if you have to change.
This is the official online map of the City of Vienna, rely on it: https://www.wien.gv.at/stadtplan/en/
(Use it to retrace the route I am suggesting.)
I guess your ship will be mooring near "Reichsbrücke" (empire bridge). Walk to the bridge and then a short distance downtown. You will find a station of subway (U-Bahn) line U1 (red line) called "Vorgartenstraße". Buy a day ticket from a ticket machine, which is valid for all means of public transport for the whole day.
Go one stop with the U1 to "Praterstern", change from the subway up to the elevated platforms. Take the next southbound S-train (Schnellbahn = urban commuter) to station "Wien Meidling". Follow the signs to the bus stops, take bus 8A to stop "Stranitzkygasse". Walk straight ahead, over the bridge, and enter the Schönbrunn premises via the upper east garden entrance.
Continue walking straight and you will hit the Gloriette building. If the weather is good, i.e. clear view, climb to the roof terrace for a magnificent view, not only of the Schönbrunn Palace and its gardens, but also of the city. If time permits you may have a coffee, too.
Walk down the hill to the main building of the palace. Depending on your time budget you may stroll around in the gardens as well. Take your visit to the palace.
After that walk to the nearby subway station "Schönbrunn" of line U4 (green line). Go to stop "Karlsplatz" and leave the mezzanine level through the exit marked "Oper" (opera).
You will be right in front of the State Opera in the very center. From there the Hofburg and all sights of the old city are in walking distance.
St. Stephen's cathedral is right in middle of the old city. Underneath the church is a station of subway U1 (red line), which will bring you back to "Vorgartenstraße" near to your ship.