I’m in the midst of doing a couple right now. A piloted drill, with proper size pilot to fit the bore, is a must, as n.r. davis mentioned.
I set the barrel in the lathe headstock and indicate in both ends of the bore, just on general belt-and-suspenders principle. If you can make a fixture that goes on your lathe carriage, that would eliminate a lot of extra motion, but I made two extensions (short and full-length) and chuck them into the tailstock. I drill 1/8” at a time, pull out the drill, clean the chips, oil the drill, and go in again. 1/8” is enough to fill the flutes with chips without getting choked up. Eventually the drill comes out the other end.
I’ve done .22 barrels by hand, with the barrel in a padded vise and the piloted drill in an electric drill motor. The disadvantage here is that if you push a little too hard, the drill can hog in and snag. Then it takes a highly delicate sense of feel to knock the gouge off the end of the hole so you can get going again. With the gradual feed of the tailstock, this is no problem. By hand, the drill tends to pull itself back into the gouge and snag again.
Fortunately, there is still the other end of the barrel for a second try.