The classical Rayleigh thermal-stability problem of an infinite horizontal fluid layer heated from below is extended to the case of a fluid confined within a rigid, horizontal circular cylinder whose wall is nonuniformly heated. The temperature distribution on the wall is specified such that, in the quiescent state, a constant temperature gradient in the fluid is established in the direction of the body force. The governing perturbation equations form a self-adjoint eigenvalue problem for the critical Rayleigh number (the stability criterion). Two different variational principles are presented, each equivalent to the eigenvalue problem. Using these principles, two approximate methods are developed for calculating upper bounds to the critical Rayleigh number. It is found that the critical Rayleigh number for the cylindrical configuration (based on a unit diameter) is about 3.8 times that for the horizontal-layer configuration (based on a unit height). The value for the cylinder is considerably lower than values calculated in previous analyses.