By means of numerical simulations, we study the influence of confinement on three-dimensional random close packed (RCP) granular materials subject to gravity. The effects of grain shape (spherical or polyhedral) and polydispersity on this dependence are investigated. In agreement with a simple geometrical model, the solid fraction is found to decrease linearly for increasing confinement no matter the grain shape. This decrease remains valid for bidisperse sphere packings although the gradient seems to reduce significantly when the proportion of small particles reaches 40% by volume. The aforementioned model is extended to capture the effect of the confinement on the coordination number.