We consider the statistics of volume fluctuations in a one-dimensional classical gas of non-interacting particles confined by a piston, and subjected to an arbitrary external potential. We show that despite the absence of interactions between particles, volume fluctuations of the gas are non-Gaussian, and are described by generalized extreme value distributions. The continuous shape parameter of these distributions is related to the ratio between the force acting on the piston, and the force acting on the particles. Gaussian fluctuations are recovered in the strong compression limit, when the effect of the external potential becomes negligible. Consequences for the thermodynamics are also discussed.