I make wine every year and many fruit flies tend to gather around the crocks. I learned to take a rather flat long Tupperware or plastic receptacle, pour apple cider vinegar mixed with equal parts water up to the level of an inch.
Grab your dish soap and squeeze several drops onto the surface. This creates a barrier to the fruit flies that will be attracted to the vinegar, they can get in- but they can't get out of the dish soap film.
In time, you'll have amassed quite a collection. This works as well on the counter top near the fruit bowl, just use a smaller dish.