There is also a force on the outside of the container due to the pressure of the gas around it
If a container can easily change its size (e.g. a balloon), then any change in these pressures will cause the container to compress or expand, due to the overall force
If a helium balloon is released, it rises. Atmospheric pressure decreases with height (p.102), so the pressure outside the balloon decreases. This causes the balloon to expand until the pressure inside drops to the same as the atmospheric pressure
You can do work on a gas mechanically, e.g. with a bike pump. The gas applies pressure to the plunger of the pump and so exerts a force on it. Work has to be done against this force to push down the plunger
This transfers energy to the kinetic energy stores of the gas particles, increasing the temperature. If the pump is connected to a tyre, you should feel the tyre getting warmer