When oil does start running short, there will be huge price shocks. Either market driven, or war-style command economies will curtail most shipping; while manufacturers pump out electrical vehicles and wind generators as fast as they can (wind generators can be built in factories and set up fairly quickly; nuclear plants require a long lead time due to site construction, planning, etc). Energy production is a relatively small part of the economy, so cutting back on the rest of the economy can pay for alternative energy supplies.
Planes can run on bio-fuel (which costs a fortune, but nobody needs to fly), cars can run on stationary energy (if you convert them to use electric motors). I don't know what container ships can use, perhaps rail will replace them in many cases (though this will be a big disruption).
It won't be pretty. There may be severe shortages. But at least the technology is being developed now.
Except it doesn't run out. Sure at some point you can't pump it out of wells any more (just like with water) and the tar sands will run out, but there's a zillion other options that are just not-quite-profitable right now. Water has sewage treatment plants and desalination, oil has various forms of biological-based sources and I'm pretty sure some straight chemical options.