The driver of a pilot vehicle noticed the teenager jump off the container and run away when the truck got to the wharf gates.
Police later traced the teenager. He was been issued a $150 infringement offence notice for riding in an unsafe position.
Phil Peters, a work colleague of the truck driver, told The Star it as a very dangerous act.
"The car following behind would not have had much time to react or stop and would have run him over. If he got caught in the truck's wheels, it would have been instant death," Peters said.
"The man was just taking a dangerous joyride. He would have seen the trailer and thought it would be cool to sit on the back of it.
"It is frustrating for us drivers, as if he had been injured or killed, the finger would point at the innocent truck driver."