What Cavities?
  Most spherical thin shells, enclosing black body radiation satisfy the dominant energy condition if they have at least $\simeq 30\%$ of the total mass-energy. Containers with less mass energy, able to sustain high pressures, contain mostly unstable radiation. If they have negligible mass energy they are unable to sustain the pressures and the radiation is unstable to gravitational collapse. Containers with black holes and radiation in thermal equilibrium, considered in the literature, are often unrealistic. 
Joseph Katz and Yasunari Okuta