Years ago, I used to clean a big house in the country where a Jack Russel terrier used to run round the house and bite my foot as I put it on the first step of my ladder. After this happening a few times I decided to discourage this dog with a spray of water from my applicator, but dog wasn't bothered by this.
So I placed my bucket close to ladder and the next time dog ran round, bucket was emptied over dog's head. It sloped off with it's tail between it's legs and sat in it's kennel drying itself off. It never bothered me again.
Some months later owner was in, came round with a cup of tea and said - I can't understand it, my dog barks at anything that moves but doesn't bother with you, so I told her what I had done a while ago. A few minutes later horse rider passing house, dog begins to do it's nut, when I hear the whoosh of a bucket of water flying through the air and dog gets another soaking, slopes off to its kennel and pleased house owner shouts - it works.