Dynamical formation of a Reissner-Nordstrom black hole with scalar hair in a cavity