The yard template problem in container ports determines the assignment of space to store containers for the vessels, which could impact container truck paths. Actually, the travel time of container truck paths is uncertain. This paper considers the uncertainty from two perspectives: (1) the yard congestion in the context of yard truck interruptions, (2) the correlation among adjacent road sections (links). A mixed-integer programming model is proposed to minimize the travel time of container trucks. The reliable shortest path, which takes the correlation among links into account is firstly discussed. To settle the problem, a Shuffled Complex Evolution Approach (SCE-UA) algorithm is designed to work out the assignment of yard template, and the A* algorithm is presented to find the reliable shortest path according to the port operator’s attitude. In our case study, one yard in Dalian (China) container port is chosen to test the applicability of the model. The result shows the proposed model can save 9% of the travel time of container trucks, compared with the model without considering the correlation among adjacent links.