We study the effect of confinement on glassy liquids using Random First Order Transition theory as framework. We show that the characteristic length-scale above which confinement effects become negligible is related to the point-to-set length-scale introduced to measure the spatial extent of amorphous order in super-cooled liquids. By confining below this characteristic size, the system becomes a glass. Eventually, for very small sizes, the effect of the boundary is so strong that any collective glassy behavior is wiped out. We clarify similarities and differences between the physical behaviors induced by confinement and by pinning particles outside a spherical cavity (the protocol introduced to measure the point-to-set length). Finally, we discuss possible numerical and experimental tests of our predictions.