This paper deals with the problem of positioning containers in a yard block of a port container terminal. The objective of the container positioning problem (CPP) is to minimise the total handling time in the block, i.e. the time required for storage and reshuffling of containers. One of the constraint types, concerning the last-in first-out (LIFO) principle, implies major modelling challenges. A mixed-integer linear programming model for the general CPP is formulated, implemented in the modelling tool Mosel, and validated by the solution of a test case using the Xpress-MP solver.