A line of hard spheres confined by a transverse harmonic potential, with hard walls at its ends, exhibits a variety of buckled structures as it is compressed longitudinally. Here we show that these may be conveniently observed in a rotating liquid-filled tube (originally introduced by Lee et al. (Adv. Mater., 29 (2017) 1704274) to assemble ordered three-dimensional structures at higher compressions). The corresponding theoretical model is transparent and easily investigated numerically, as well as by analytic approximations. Hence we explore a wide range of predicted structures occurring via bifurcation, of which the stable ones are also observed in our experiments. Qualitatively similar structures have previously been found in trapped ion systems.