I believe this might happen when dock scales up depending of the amount of apps running and becomes a little big bigger. I was annoyed by this too and disabled scaling.