We study the deterministic dynamics of non-interacting classical gas particles confined to a one-dimensional box as a pedagogical toy model for the relaxation of the Boltzmann distribution towards equilibrium. Hard container walls alone induce a uniform distribution of the gas particles at large times. For the relaxation of the velocity distribution we model the dynamical walls by independent scatterers. The Markov property guarantees a stationary but not necessarily thermal velocity distribution for the gas particles at large times. We identify the conditions for physical walls where the stationary velocity distribution is the Maxwell distribution. For our numerical simulation we represent the wall particles by independent harmonic oscillators. The corresponding dynamical map for oscillators with a fixed phase (Fermi–Ulam accelerator) is chaotic for mesoscopic box dimensions.