We've had a coffee machine for decades now, but have been flushing coffee grinds down the drain and in the last five or so years scooping them out with a teaspoon into a compost bin.
I decided to make things right and build a proper knock-box myself, as all the options on the market were, in my opinion, a bit average..
For the base bucket, I bought a Large Bamboo Utensil Holder from Amazon. I marked out and cut two 32mm holes opposite each other with a hole saw and cut a mouth out with a hand-help jigsaw, marking it out with a template first.
For the bar, I used a length of left over 28mm curtain rail/pipe, encased in a 30mm clear reinforced suction hose and capped with a pair of white plastic pipe ends. I've also put some rubber grommets in to amortise the knock impact.