While Gatsby -- yet to change his name and still going by James Gatz -- is still young and unsure of his direction in life, he meets an old millionaire named Dan Cody. His first impression is favorable; Cody's yacht is a symbol of the man's wealth and helps to ignite Gatsby's obsession with wealth and social status.
To the young Gatz, resting on his oars and looking up at the railed deck, the yacht represented all the beauty and glamour in the world.
He was employed in a vague personal capacity—while he remained with Cody he was in turn steward, mate, skipper, secretary, and even jailor, for Dan Cody sober knew what lavish doings Dan Cody drunk might soon be about, and he provided for such contingencies by reposing more and more trust in Gatsby.
(Fitzgerald, The Great Gatsby, mrbye.com)
Gatsby learns social lessons from Cody, as well as beginning his understanding of alcohol and its effects on people; he also learns how much money a person can make by selling it, a practice which becomes illegal. Cody's lifestyle and reputation appeals to Gatsby even as Cody's habits and the people around him repulse Gatsby, and he starts his journey to personal wealth. The ability to buy and sell anything he wants is a crucial part of Gatsby's eventual public persona. Finally, Cody's death -- which may have been murder -- gives Gatsby his first taste of real wealth, an inheritance which allows Cody's paramour to inherit the rest of the money. The lessons Gatsby learns from living with Cody stay with him, and help to create the persona of Jay Gatsby.