Ricky Brewer, 18, from Aldershot, filmed himself carrying out the dangerous feat with another youth as the train travelled between Heron Quays and Canary Wharf.
The footage shows Brewer and his accomplice climbing on top of a DLR train at Heron Quays before jumping into the dock and swimming to safety.
The pair flee the scene on foot.
British Transport Police (BTP) launched an investigation after they were made aware of the YouTube footage in September.
Officers positively identify Brewer and he was subsequently arrested and charged.
Last week at Westminster Magistrates’ Court he admitted one charge of endangering the safety of a person conveyed on the railway.
He was given a 12 week prison sentence suspended for 18 months, must attend an 18 month rehabilitation activity requirement, complete 150 hours of unpaid work, pay a £85 fine and he was also ordered to pay £115 victim surcharge.
PC Victoria Callaghan, investigating officer, said: “Without care for his own safety, Brewer jumped from that train into the water and the fall could have easily killed or caused him serious injury.
“Every day our officers experience tragedy on the railway. If Brewer knew the heartbreak and sadness we experience when we tell a family that their loved one has been killed, I am sure he wouldn’t have put himself in such danger.
“We will work tirelessly to ensure this behaviour is stopped, otherwise it will only be a matter of time before someone is killed or seriously injured.”
Steve Burton, Transport for London’s Director of Enforcement, added: “The actions of Brewer not only posed a serious risk to his own safety, but also the safety of his fellow passengers.
“They were extremely selfish, reckless and ultimately dangerous and the sentence handed down by the court shows that these actions will not be tolerated.”
Sentenced: Teenager from Aldershot who carried out death-defying stunt on DLR train