The dynamic response of a gas bubble entrapped in a cavity on the surface of a submerged solid subject to an acoustic field is investigated in the linear approximation. We derive semi-analytical expressions for the resonance frequency, damping, and interface shape of the bubble. For the liquid phase, we consider two limit cases: potential flow and unsteady Stokes flow. The oscillation frequency and interface shape are found to depend on two dimensionless parameters: the ratio of the gas stiffness to the surface tension stiffness, and the Ohnesorge number, representing the relative importance of viscous forces. We perform a parametric study and show, among others, that an increase in the gas pressure or a decrease in the surface tension leads to an increase in the resonance frequency until an asymptotic value is reached.