You are probably well accustomed to seeing giant 18-wheelers driving
alongside you on the freeway. Those trucks are usually on a mission,
one that involves delivering cargo from one place to another. Truckers are expected to drive long hours, and they travel even in harsh weather, e.g., rain or snow. Indeed, trucks are known for constantly pressing on towards their destinations, so it would be logical to assume that this phrase originates from the persistence seen in truck traveling.
I tried to get an idea on how far back in history this expression goes, but it looks like it didn't exist until the later half of the 20th century, so it's a relatively recent phrase. For example, in the Roland Record newspaper from 1971, it reads:
"The seniors recently voted what their class motto would be: 'Keep on truckin' and 'We've only just
Robert Hendrickson, writer of The Facts on File Encyclopedia of Word and Phrase Origins, mentions that etymologist Joseph T. Shipley had the following to say regarding the expression:
"Comes from the great marathon dance contests that were part of our 1930s scene, when all the partners
clung to one another, half-asleep, but on and on moving around the dance hall through the night, like
the great trucks that go endlessly across our continent through the dark hours as they 'keep on truckin'
for the prize."
Maybe that's the case, maybe not. Either way, this phrase doesn't seem to be that old.
Reference: Facts on File Encyclopedia of Word and Phrase Origins
Note: The origins for most common idioms cannot be said with a certainty. What's provided are theories that may be plausible to how a phrase originated, but not necessarily so.
In addition, quotes that contain a particular phrase may be taken from old newspapers, poems, or books that were written centuries ago, but this by no means confirms that the phrase originates from said newspapers, poems, or books. In all likelihood, if an expression is being used in a newspaper, it's probably already a well known saying and is from an older time.
* Having little sleep last night and with work startingin two hours, I'll have to keep on truckin' through the day if I want to earn my paycheck and keep my job.