The cartridge works by being contained in a firing chamber in all directions except down the rifle bore. A firing pin contacts the primer igniting it which in turn ignites the powder. Pressures inside the brass quickly reaches a very high value (e.g. 30,00 psi) and expands the brass to become intimate with the chamber wall. The bullet is then pushed in the direction that releases this pressure, down the barrel. After the bullet leaves the barrel the pressure is released and the brass is pulled away from the chamber walls just enough to be extracted easily.
See a typical rifle cartridge picure below. Critical items related to any cartridge is it's caliber, bullet weight, expected velocity, headspace, overall length and primer type. In the picture accompanying this show the various critical dimensions that need to be tracked and verified.