I plant mine in a bag that has a flap on the side, I can remove potatoes when ready and the plant keeps making new ones. Wish I could post a picture.
I grow potatoes in 5 gallon buckets. I get good yields and no bugs. 2 harvests per year.

I do that too. The key is to have a totally black bag. Hold the bag up to the sun and if you see sunlight through it, it isn’t going to work well. All you will get is roots and no potatoes, or they will be very small.