Alfie has started to do this and he is 6 months on the 20th and being neutered on 23rd.
a member on here said it might be because he is letting other dogs know he is there. I suppose letting them know he is 'sexually' ready. We have a 7month German shepherd bitch and perhaps he is telling her "I'm here!"
We have been watching him very closely and he hasn't done it for a few days. He's humping the MALE German shepherd's tail non stop though