A geometric realization of confinement