A truck driver has made a lucky escape after quick-thinking passers-by pulled the man from his vehicle's cabin before it burst into flames in Port Melbourne on Saturday morning.

The truck, carrying an empty shipping container, was on the West Gate Freeway about 2am and about to exit on to City Link when it crashed through metal road barriers.

The truck travelled about 150 metres before coming to a stop in a reserve between the exit and west-bound lanes of the freeway, police said.

Quick-thinking passers-by pulled the driver from the cabin of the truck before it burst into flames.